From bc8a33757432626846e83037c6f68e025e232a03 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Wed, 17 Aug 2022 13:47:19 +0800 Subject: [PATCH] edit-admin-srv_config --- admin/controllers/biz/Srv.php | 8 +++++++- api/controllers/plan/Biz.php | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/controllers/biz/Srv.php b/admin/controllers/biz/Srv.php index 38bf5bbb..b15e52d7 100644 --- a/admin/controllers/biz/Srv.php +++ b/admin/controllers/biz/Srv.php @@ -136,6 +136,9 @@ class Srv extends HD_Controller{ 'type' => $info['type'], 'is_def' => 1 ]; + if($info['type']==2){ + $where["json_extract(jsondata, '$.type') = '{$info['jsondata']['type']}'"] = null; + } $this->biz_settle_srv_model->update(['is_def'=>0],$where); } $data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE); @@ -181,8 +184,11 @@ class Srv extends HD_Controller{ 'biz_id' => $info['biz_id'], 'title' => $info['title'], 'type' => $info['type'], - 'is_def' => 1 + 'is_def' => 1, ]; + if($info['type']==2){ + $where["json_extract(jsondata, '$.type') = '{$info['jsondata']['type']}'"] = null; + } $this->biz_settle_srv_model->update(['is_def'=>0],$where); } $data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE); diff --git a/api/controllers/plan/Biz.php b/api/controllers/plan/Biz.php index 4c623c16..293cf1bc 100644 --- a/api/controllers/plan/Biz.php +++ b/api/controllers/plan/Biz.php @@ -282,6 +282,7 @@ class Biz extends HD_Controller 'title' => $insurance_img['product'], 'type' => 2, 'is_def' => 1, + "json_extract(jsondata, '$.type') = '1'" => null, ]; $fd_row = $this->biz_settle_srv_model->get($where); } @@ -307,6 +308,7 @@ class Biz extends HD_Controller 'title' => $business_img['product'], 'type' => 2, 'is_def' => 1, + "json_extract(jsondata, '$.type') = '2'" => null, ]; $bis_fd_row = $this->biz_settle_srv_model->get($where); }