|
...
|
...
|
@@ -108,14 +108,15 @@ class Extension3915ModuleController extends BaseController |
|
|
|
$this->fail('当前项目不能调用当前方法');
|
|
|
|
}
|
|
|
|
$moduleFieldModel = new ExtensionModuleField();
|
|
|
|
$filedList = $moduleFieldModel->where(['module_id' => $this->param['module_id']])->pluck('field_name', 'id')->toArray();
|
|
|
|
$filedList = $moduleFieldModel->where(['module_id' => $this->param['module_id']])->pluck( 'id','field_name')->toArray();
|
|
|
|
if(empty($filedList)){
|
|
|
|
$this->response('请先设置字段,再添加数据',Code::SUCCESS);
|
|
|
|
$this->fail('请先设置字段,再添加数据');
|
|
|
|
}
|
|
|
|
$data = $this->param['data'];
|
|
|
|
$moduleValueModel = new ExtensionModuleValue();
|
|
|
|
$key_filedId = [];
|
|
|
|
$resultData = [];
|
|
|
|
try {
|
|
|
|
foreach ($data as $k => $v){
|
|
|
|
foreach ($v as $k1 => $v1){
|
|
|
|
if($k == 0){
|
|
...
|
...
|
@@ -137,6 +138,9 @@ class Extension3915ModuleController extends BaseController |
|
|
|
$moduleValueModel->truncate();
|
|
|
|
$moduleValueModel->insertAll($resultData);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('当前文件不能导入,请修改后再导入');
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$resultData);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|