...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
namespace app\admin\controller\mobile;
|
|
|
|
|
|
use app\common\controller\Backend;
|
|
|
use app\admin\model\mobile\QuestionCategory;
|
|
|
use think\Db;
|
|
|
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
|
|
use PhpOffice\PhpSpreadsheet\Reader\Csv;
|
...
|
...
|
@@ -320,6 +321,7 @@ class Almighty extends Backend |
|
|
}
|
|
|
|
|
|
$fieldArr['题目类型'] = 'type';
|
|
|
$fieldArr['全能题库分类'] = 'target_id';
|
|
|
// 循环输出26个大写英文字母
|
|
|
for($i=65;$i<91;$i++){
|
|
|
$letter = strtoupper(chr($i));
|
...
|
...
|
@@ -382,6 +384,16 @@ class Almighty extends Backend |
|
|
if (!$insert) {
|
|
|
$this->error(__('No rows were updated'));
|
|
|
}
|
|
|
|
|
|
foreach ($insert as &$v) {
|
|
|
$category = QuestionCategory::where('name',$v['target_id'])->field('id')->find();
|
|
|
if(!$category) {
|
|
|
$this->error('含有不存在的全能题库分类');
|
|
|
}else{
|
|
|
$v['target_id'] = $category['id'];
|
|
|
}
|
|
|
}
|
|
|
unset($v);
|
|
|
|
|
|
try {
|
|
|
//是否包含admin_id字段
|
...
|
...
|
|