|
...
|
...
|
@@ -146,12 +146,33 @@ class TemplateController extends BaseController |
|
|
|
$data['data_source'] = $data['source'];
|
|
|
|
$data['data_source_id'] = $data['source_id'];
|
|
|
|
|
|
|
|
// 不需要数据id
|
|
|
|
if(in_array($data['data_source'],['index'])){
|
|
|
|
$data['data_source_id'] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
unset($data['source']);
|
|
|
|
unset($data['source_id']);
|
|
|
|
|
|
|
|
TemplateLogic::instance()->save($data);
|
|
|
|
$id = TemplateLogic::instance()->save($data);
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
$info = TemplateLogic::instance()->getInfo($id['id']);
|
|
|
|
$info['source'] = $info['data_source'];
|
|
|
|
$info['source_id'] = $info['data_source_id'];
|
|
|
|
unset($info['data_source']);
|
|
|
|
unset($info['data_source_id']);
|
|
|
|
unset($info['template_id']);
|
|
|
|
unset($info['created_at']);
|
|
|
|
unset($info['updated_at']);
|
|
|
|
unset($info['css']);
|
|
|
|
unset($info['script']);
|
|
|
|
unset($info['data_ext']);
|
|
|
|
|
|
|
|
return $this->success($info,Code::SUCCESS,'保存成功');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->response('保存成功');
|
|
|
|
return $this->response('保存失败',Code::SYSTEM_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|