From 1b682e163e8e664e007b8367f91de393f48ae0d5 Mon Sep 17 00:00:00 2001 From: lcc <1127794702@qq.com> Date: Thu, 13 Jun 2024 14:07:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=A6=E7=AE=A1=E5=AE=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/wxapp/licheb/Customers.php | 4 +-- api/controllers/wxapp/licheb/User.php | 35 +++++++++++----------- common/libraries/CarHome.php | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 5d451698..4ff41b24 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -1132,7 +1132,7 @@ class Customers extends Wxapp $where['b.status<>'] = 2; } } -// $group_id == 1 && $where['a.admin_id'] = $this->myuid; + $group_id == 1 && $where['a.admin_id'] = $this->myuid; $count = $this->mdCustomerVisitData->count_visit($where); } else {//数据看板 数据列表 if ($tab_id == 2) {//今日 @@ -1145,7 +1145,7 @@ class Customers extends Wxapp if ($visit == 3) {//今日/本月线索 $where = ['biz_id' => $this->biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0, 'c_time>=' => strtotime($s_c_time) , 'c_time<=' => strtotime($e_c_time)]; -// $group_id == 1 && $where['admin_id'] = $this->myuid; + $group_id == 1 && $where['admin_id'] = $this->myuid; $count = $this->customers_model->count($where); } else if ($visit == 5 || $visit == 7) {//今日/本月到店/战败 $oplogs_type = $visit == 7 ? 7 : 4;//4到店7战败 diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index c9ab44c7..a7343175 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -308,27 +308,27 @@ class User extends Wxapp $this->load->model('receiver/receiver_customers_visit_data_model', 'mdCustomerVisitData'); $where = ['status>' => -1, 'is_top' => 1, 'biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status!=' => 2]; $group_id == 1 && $where['admin_id'] = $uid; - $group_id == 4 && $where['brand_id!='] = 3; //客户成功经理过滤 $gz_count = $this->customers_model->count($where); $where = ['status' => 0, 'biz_id' => $biz_id]; $group_id == 1 && $where['admin_id'] = $uid; - $group_id == 4 && $where['brand_id!='] = 3; //客户成功经理过滤 $sign_count = 0; $where = ['status' => 1, 'biz_id' => $biz_id]; $group_id == 1 && $where['admin_id'] = $uid; - $group_id == 4 && $where['brand_id!='] = 3; //客户成功经理过滤 $loan_count = 0; //客户代办事项--未派单客户 - $where = ['admin_id' => 0, 'biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0]; - $unuse_count = $this->customers_model->count($where); - $defeat_count = $this->customers_model->count(['biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'if_defeat' => 1, 'status>' => -1]); - $clues_count = $this->clues_model->count(['biz_id' => $biz_id, 'status' => 0]); - $customer_op_list = [ - ['title' => '线索池(人)', 'icon' => 'icon-daifenpei', 'total' => $clues_count, 'page' => '/pages/clues/index'], - ['title' => '待分配客户(人)', 'icon' => 'icon-daifenpei', 'total' => $unuse_count, 'page' => '/pages/customer/allot/index'], - ['title' => '战败申请(人)', 'icon' => 'icon-statistics-custom-5', 'total' => $defeat_count, 'page' => '/pages/customer/optDefeat/index'], - ]; - + if ($group_id == 1) { + $customer_op_list = []; + } else { + $where = ['admin_id' => 0, 'biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0]; + $unuse_count = $this->customers_model->count($where); + $defeat_count = $this->customers_model->count(['biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'if_defeat' => 1, 'status>' => -1]); + $clues_count = $this->clues_model->count(['biz_id' => $biz_id, 'status' => 0]); + $customer_op_list = [ + ['title' => '线索池(人)', 'icon' => 'icon-daifenpei', 'total' => $clues_count, 'page' => '/pages/clues/index'], + ['title' => '待分配客户(人)', 'icon' => 'icon-daifenpei', 'total' => $unuse_count, 'page' => '/pages/customer/allot/index'], + ['title' => '战败申请(人)', 'icon' => 'icon-statistics-custom-5', 'total' => $defeat_count, 'page' => '/pages/customer/optDefeat/index'], + ]; + } $where = ['status' => 0, 'biz_id' => $biz_id]; $group_id == 1 && $where['sale_id'] = $uid; $fq_total = $this->orders_model->count($where); @@ -405,9 +405,6 @@ class User extends Wxapp //线索 $where_today_xs = ['biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)]; $where_month_xs = ['biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)]; - //企微 - $where_today_qy = ['change_type' => 'add_external_contact', 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)]; - $where_month_qy = ['change_type' => 'add_external_contact', 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)]; //到店 $where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1, "id in(select customer_id from lc_receiver_customer_oplogs where type=4 and uid in({$str_uids}) and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ")" => null]; @@ -418,6 +415,10 @@ class User extends Wxapp "id in(select customer_id from lc_receiver_customer_oplogs where type=7 and uid in({$str_uids}) and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ")" => null]; $where_month_defeat = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1, "id in(select customer_id from lc_receiver_customer_oplogs where type=7 and uid in({$str_uids}) and c_time>=" . strtotime($s_month) . " and c_time<=" . strtotime($e_month) . ")" => null]; + if ($group_id == 1) { + $where_today_xs['admin_id'] = $uid; + $where_month_xs['admin_id'] = $uid; + } $statistics = [ ['today' => ['title' => '今日', 'value' => $this->customers_model->count($where_today_xs), 'url' => '/pages/customer/filterList/index?status=3&visit=3&title=客户'] , 'month' => ['title' => '本月客户', 'value' => $this->customers_model->count($where_month_xs)]], @@ -436,7 +437,7 @@ class User extends Wxapp 'deallist' => $deallist, 'customer_op_list' => $customer_op_list, 'levelSt' => $levelSt, - 'where_today_qy' => $where_today_qy, + 'where_today_qy' => [], 'statistics' => $statistics, 'str_uids' => $str_uids ]; diff --git a/common/libraries/CarHome.php b/common/libraries/CarHome.php index 1a6d00a6..0842d3ac 100644 --- a/common/libraries/CarHome.php +++ b/common/libraries/CarHome.php @@ -84,7 +84,7 @@ class CarHome $data['outSystemCode'] = $this->outSystemCode; $data['storeId'] = $this->storeId; //城市转换 - $data['registerCityId'] = $this->city_lists[$data['registerCityId']] ? $this->city_lists[$data['registerCityId']] : $this->other_city; + $data['registerCityId'] = $this->city_lists[$data['registerCityId']] ?: $this->other_city; debug_log("post_data:" . json_encode($data, JSON_UNESCAPED_UNICODE)); list($req, $header, $httpStatus) = $this->send($post_url, $data, self::METHOD_POST); debug_log("result:" . $req);