From 84802d00a48c6ef170843f788c660390139f8325 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 2 Jun 2022 13:39:07 +0800 Subject: [PATCH] user_602 --- api/controllers/plan/Licheb.php | 13 ++++++++---- api/controllers/wxapp/licheb/Customers.php | 23 +++++++++++++++++++++- api/controllers/wxapp/licheb/User.php | 2 +- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/api/controllers/plan/Licheb.php b/api/controllers/plan/Licheb.php index 9fe3f81e..55f5c87b 100644 --- a/api/controllers/plan/Licheb.php +++ b/api/controllers/plan/Licheb.php @@ -147,6 +147,9 @@ class Licheb extends HD_Controller foreach ($res as $key => $value) { $sales_id = $id = $value['id']; $biz_id = intval($value['biz_id']); + if ($biz_id == 1 || $biz_id == 110) {//门店用户不写入 + continue; + } $where_sal = ['t_day' => $t_day, 'sales_id' => $sales_id, 'biz_id' => $biz_id]; $re_sal = $this->mdCustomerVisitSales->get($where_sal); if (!$re_sal) {//判断当天是否已加入 @@ -185,7 +188,6 @@ class Licheb extends HD_Controller public function users_log() { $params = $this->input->get(); - $time = strtotime("-1 day");//昨天此时的时间戳 $hour = date('H.i'); if (($hour > 00.00 && $hour < 03.00) || $params['sd']) { if ($params['sd']) { @@ -197,13 +199,13 @@ class Licheb extends HD_Controller } $this->load->model('app/licheb/app_licheb_users_model', 'mdUsers'); $this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog'); + $time = strtotime("-1 day");//昨天此时的时间戳 $size = 200;//每次最多处理多少条 $rds = intval($this->input->get('rds')); $redis = &load_cache('redis'); - $redisKey = 'app_licheb_users_log_id'; $log_date = date('Y-m-d', $time); - $re_v = $this->mdUsersLog->get(array('log_date' => $log_date));//查找当天是否有数据 - if (!$re_v || $rds) { + $redisKey = 'app_licheb_users_log_id_' . $log_date; + if ($rds) { $redis->delete($redisKey); } $id = $redis->get($redisKey); @@ -225,6 +227,9 @@ class Licheb extends HD_Controller foreach ($res as $key => $value) { $sale_id = $id = $value['id']; $biz_id = intval($value['biz_id']); + if ($biz_id == 1 || $biz_id == 110) {//门店用户不写入 + continue; + } $re_log = $this->mdUsersLog->get(['log_date' => $log_date, 'sale_id' => $sale_id, 'biz_id' => $biz_id]); if (!$re_log) {//判断当天是否已加入 $s_time = strtotime($log_date . ' 00:00:00'); diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 05d36798..c32eb140 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -709,6 +709,22 @@ class Customers extends Wxapp throw new Exception('分配成功', API_CODE_SUCCESS); } + /** + * Notes:客户待回访tab + * Created on: 2022/6/2 10:20 + * Created by: dengbw + * @return array + */ + protected function get_visit_tabs() + { + $status = $this->input_param('status'); + $tabs = []; + if ($status == 1) {//跟进客户 + $tabs = [['name' => '本日新增跟进', 'id' => 1], ['name' => '逾期未跟进', 'id' => 3]]; + } + return ['list' => $tabs]; + } + /** * Notes:客户回访记录列表 * Created on: 2021/10/21 14:27 @@ -724,6 +740,7 @@ class Customers extends Wxapp $page = intval($params['page']); $size = intval($params['size']); $status = intval($params['status']); + $tab_id = intval($params['visit_tab_id']); !$page && $page = 1; !$size && $size = 10; $t_day = date('Y-m-d'); @@ -732,7 +749,11 @@ class Customers extends Wxapp if ($status == 2) {//已跟进 $where['b.status'] = 2; } else { - $where['b.status<>'] = 2; + if ($tab_id) { + $where['b.status'] = $tab_id; + } else { + $where['b.status<>'] = 2; + } } $group_id == 1 && $where['a.admin_id'] = $this->session['uid']; $count = $this->mdCustomerVisitData->count_visit($where); diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index 482d0af5..85a2802f 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -341,7 +341,7 @@ class User extends Wxapp , ['title' => '今日需跟进 >', 'num' => $b_num_1, 'url' => '/pages/customer/filterList/index?level=B&status=1&visit=1&title=B级今日需跟进'] , ['title' => '今日已跟进 >', 'num' => $b_num_2, 'url' => '/pages/customer/filterList/index?level=B&status=2&visit=1&title=B级今日已跟进']]], ]; - $wl_num = $this->mdCustomerVisitData->count_visit($where_v); + $wl_num = $this->mdCustomerVisitData->count_visit(array_merge($where_v, ['b.status<>' => 2])); $data = [ 'wl_count' => ['title' => '待跟进客户(人)', 'num' => $wl_num, 'url' => '/pages/customer/filterList/index?status=1&visit=1&title=待跟进客户'], 'gz_count' => ['title' => '特别关注客户(人)', 'num' => $gz_count, 'url' => '/pages/customer/filterList/index?istop=1&title=特别关注客户'],