作者 lyh

gx

@@ -39,37 +39,4 @@ class ServiceController extends BaseController @@ -39,37 +39,4 @@ class ServiceController extends BaseController
39 } 39 }
40 40
41 41
42 -  
43 - /**  
44 - * @remark :参数验证  
45 - * @name :validParam  
46 - * @author :lyh  
47 - * @method :post  
48 - * @time :2023/6/25 14:03  
49 - */  
50 - public function verifyParam(){  
51 - $this->request->validate([  
52 - 'address' => 'required',  
53 - 'duty_phone' => 'required',  
54 - 'landline_telephone' => 'required',  
55 - 'free_hotline' => 'required',  
56 - 'enterprise_qq' => 'required',  
57 - 'android' => 'required',  
58 - 'official_account' => 'required',  
59 - 'ios' => 'required',  
60 - 'images' => 'required',  
61 - 'app_remark' => 'required',  
62 - ],[  
63 - 'address.required' => '地址不能为空',  
64 - 'duty_phone.required' => '值班电话不能为空',  
65 - 'landline_telephone.required' => '座机电话不能为空',  
66 - 'free_hotline.required' => '免费热线不能为空',  
67 - 'enterprise_qq.required' => '企业qq不能为空',  
68 - 'android.required' => '安卓不能为空',  
69 - 'official_account.required' => '公众号不能为空',  
70 - 'ios.required' => 'ios下载地址不能为空',  
71 - 'images.required' => '轮播图不能为空',  
72 - 'app_remark.required' => 'app下载备注信息不能为空',  
73 - ]);  
74 - }  
75 } 42 }
@@ -54,9 +54,12 @@ class ServiceLogic extends BaseLogic @@ -54,9 +54,12 @@ class ServiceLogic extends BaseLogic
54 * @time :2023/6/25 13:45 54 * @time :2023/6/25 13:45
55 */ 55 */
56 public function serviceSave(){ 56 public function serviceSave(){
57 - $rs = $this->model->insert($this->param['data']);  
58 - if($rs === false){  
59 - $this->fail('批量插入失败'); 57 + //删除以前的配置
  58 + try {
  59 + $this->model->del(['type'=>1]);
  60 + $this->model->insert($this->param['data']);
  61 + }catch (\Exception $e){
  62 + $this->fail('error');
60 } 63 }
61 return $this->success(); 64 return $this->success();
62 } 65 }