修改车管家数据统计

This commit is contained in:
lcc
2024-06-13 14:07:10 +08:00
parent 210077f73e
commit 1b682e163e
3 changed files with 21 additions and 20 deletions
+2 -2
View File
@@ -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战败
+18 -17
View File
@@ -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
];
+1 -1
View File
@@ -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);