正在显示
2 个修改的文件
包含
10 行增加
和
6 行删除
| @@ -104,11 +104,13 @@ class ATemplateController extends BaseController | @@ -104,11 +104,13 @@ class ATemplateController extends BaseController | ||
| 104 | * @method :post | 104 | * @method :post |
| 105 | * @time :2023/7/10 15:30 | 105 | * @time :2023/7/10 15:30 |
| 106 | */ | 106 | */ |
| 107 | - public function setHead(ATemplateLogic $aTemplateLogic){ | 107 | + public function setHeadFooter(ATemplateLogic $aTemplateLogic){ |
| 108 | $this->request->validate([ | 108 | $this->request->validate([ |
| 109 | - 'values'=>'required' | 109 | + 'head'=>'required', |
| 110 | + 'footer'=>'required' | ||
| 110 | ],[ | 111 | ],[ |
| 111 | - 'values.required' => 'values不能为空' | 112 | + 'head.required' => 'head不能为空', |
| 113 | + 'footer.required' => 'footer不能为空' | ||
| 112 | ]); | 114 | ]); |
| 113 | $aTemplateLogic->setHeadSave(); | 115 | $aTemplateLogic->setHeadSave(); |
| 114 | $this->response('success'); | 116 | $this->response('success'); |
| @@ -132,9 +132,11 @@ class ATemplateLogic extends BaseLogic | @@ -132,9 +132,11 @@ class ATemplateLogic extends BaseLogic | ||
| 132 | DB::beginTransaction(); | 132 | DB::beginTransaction(); |
| 133 | try { | 133 | try { |
| 134 | $serviceSettingModel->del(['type'=>2]); | 134 | $serviceSettingModel->del(['type'=>2]); |
| 135 | - $this->param['type'] = 2; | ||
| 136 | - $this->param['key'] = 'head'; | ||
| 137 | - $serviceSettingModel->add($this->param); | 135 | + $data = [ |
| 136 | + ['type'=>2,'key'=>'head','values'=>$this->param['head'],'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')], | ||
| 137 | + ['type'=>2,'key'=>'footer','values'=>$this->param['footer'],'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')] | ||
| 138 | + ]; | ||
| 139 | + $serviceSettingModel->insert($data); | ||
| 138 | DB::commit(); | 140 | DB::commit(); |
| 139 | }catch (Exception $e){ | 141 | }catch (Exception $e){ |
| 140 | DB::rollBack(); | 142 | DB::rollBack(); |
-
请 注册 或 登录 后发表评论