From aabb0e6579aa0723ae9ba944ee109cee79ac9d29 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Wed, 3 Nov 2021 09:49:55 +0800 Subject: [PATCH] edit-admin-cus_cancel --- admin/controllers/receiver/Clues.php | 2 +- admin/controllers/receiver/Customer.php | 36 +++++- admin/views/receiver/customer/get_adviser.php | 114 ++++++++++++++++++ admin/views/receiver/customer/lists.php | 7 ++ api/views/wxapp/licheb/html2pdf/car_fh.php | 2 +- api/views/wxapp/licheb/protocol/car_fh.php | 2 +- 6 files changed, 158 insertions(+), 5 deletions(-) create mode 100644 admin/views/receiver/customer/get_adviser.php diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 595f8991..3d51b1b5 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -588,7 +588,7 @@ class Clues extends HD_Controller foreach ($ids_arr as $val) { $clues_row = $clues_rows[$val][0]; //判断是否已分配 - $cus_row = $this->customers_model->get(['rid' => $val]); + $cus_row = $this->customers_model->get(['rid' => $val,'status>='=>0]); if ($clues_row && !$cus_row) { $jsondata = json_decode($clues_row['jsondata'], true); $add_data = [ diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index caba8973..dba170be 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -432,7 +432,17 @@ class Customer extends HD_Controller public function del() { - // TODO: Implement del() method. + $id = $this->input->post('id'); + $row = $this->customers_model->get(['id'=>$id,'cf_title'=>'平台分配']); + if(!$row){ + return $this->show_json(SYS_CODE_FAIL, '客户不存在!'); + } + $res = $this->customers_model->update(['status'=>-1],['id'=>$id]); + if($res){ + return $this->show_json(SYS_CODE_SUCCESS, '删除成功'); + }else{ + return $this->show_json(SYS_CODE_FAIL, '删除失败'); + } } public function batch() @@ -444,7 +454,29 @@ class Customer extends HD_Controller { // TODO: Implement export() method. } - + //改派 + public function edit_adviser(){ + $id = $this->input->get_post('id'); + $biz_id = $this->input->post('biz_id'); + $row = $this->customers_model->get(['id'=>$id,'cf_title'=>'平台分配']); + if(!$row){ + return $this->show_json(SYS_CODE_FAIL, '客户不存在!'); + } + if($this->input->post()){ + if(!$biz_id) return $this->show_json(SYS_CODE_FAIL, '请选择门店'); + if($biz_id == $row['biz_id']) return $this->show_json(SYS_CODE_FAIL, '请选择不同门店'); + $res = $this->customers_model->update(['biz_id'=>$biz_id,'admin_id'=>0],['id'=>$id]); + if($res){ + $log = "改派订单"; + $this->addLog(['customer_id'=>$row['id'],'log'=>$log,'type'=>0]); + return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); + }else{ + return $this->show_json(SYS_CODE_FAIL, '保存失败'); + } + } + $this->data['id'] = $id; + return $this->show_view('receiver/customer/get_adviser'); + } /** * Notes:增加日志 * Created on: 2021/7/23 10:48 diff --git a/admin/views/receiver/customer/get_adviser.php b/admin/views/receiver/customer/get_adviser.php new file mode 100644 index 00000000..789d6fbe --- /dev/null +++ b/admin/views/receiver/customer/get_adviser.php @@ -0,0 +1,114 @@ +
+ diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index de855202..151b0a5f 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -196,6 +196,13 @@