From e739df6215839e964d9014c0b3fa4a13235c69a7 Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Mon, 20 Oct 2025 09:36:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E7=B4=A2=E5=92=8C?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=A7=A3=E9=94=81=E5=88=A4=E6=96=AD=20&&=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/controllers/receiver/Clues.php | 8 +- admin/controllers/receiver/Customer.php | 9 +- admin/views/receiver/clues/lists.php | 5 +- admin/views/receiver/customer/lists.php | 5 +- agent/admin/controllers/api/home/Data.php | 2 +- .../admin/controllers/pingan/car/Product.php | 2 +- .../controllers/pingan/organization/User.php | 166 ++++++++++-------- .../controllers/pingan/receiver/Customer.php | 5 +- .../receiver/Receiver_customers_model.php | 4 + 9 files changed, 129 insertions(+), 77 deletions(-) diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index d5968cf3..517f1442 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -164,7 +164,7 @@ class Clues extends HD_Controller $lists = []; if ($count) { $fileds = 'id,name,mobile,brand_id,series_id,cf_id,cf2_id,c_time,admin_id,status,status2,en_time, - province_id,city_id,county_id,biz_id,p_time,u_time,rec_time'; + province_id,city_id,county_id,biz_id,p_time,u_time,rec_time,app_id'; $rows = $this->clues_model->select($where, 'en_time desc,id desc', $page, $size, $fileds); $map_admin = $map_cf_pid = $cf_title_arr = []; @@ -262,6 +262,12 @@ class Clues extends HD_Controller $val['p_time'] = ''; } $val['rec_time'] = $val['rec_time'] != '0000-00-00 00:00:00' ? $val['rec_time'] : ''; + $is_unlock = ''; + if ($val['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY && $val['status'] > 0) { + $unlockCustomer = $this->customers_model->get(['rid' => $val['rid'], 'un_lock' => Receiver_customers_model::LOCK_STATUS]); + $is_unlock = $unlockCustomer ? '已解锁' : '未解锁'; + } + $val['is_unlock'] = $is_unlock; $lists[] = $val; } } diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 3451f05a..06ae3bc9 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -56,7 +56,7 @@ class Customer extends HD_Controller //$wxqyAry = $this->customers_model->wxqyAry(); $wxgrAry = $this->customers_model->wxgrAry(); if ($count) { - $fileds = 'id,cid,name,mobile,cf_title,p_time,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxgr,c_time,county_id,brand_id,series_id'; + $fileds = 'id,rid,cid,name,mobile,cf_title,p_time,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxgr,c_time,county_id,brand_id,series_id,un_lock'; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); //获取车管家 $admin_id_arr = array_unique(array_column($rows, 'admin_id')); @@ -107,7 +107,11 @@ class Customer extends HD_Controller if ($brands[$val['brand_id']]) { $brand_detail .= '-' . $series[$val['series_id']][0]['name']; } - + $clues = $this->clues_model->get(['id' => $val['rid']]); + $is_unlock = ''; + if ($clues['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) { + $is_unlock = $val['un_lock'] ? '已解锁' : '未解锁'; + } $lists[] = array( 'id' => $val['id'], 'cid' => $val['cid'], @@ -127,6 +131,7 @@ class Customer extends HD_Controller 'c_time' => $val['c_time'] != '0' ? date('Y-m-d H:i:s', $val['c_time']) : '', 'p_time' => $val['p_time'], 'cont_time' => $val['cont_time'] != '0000-00-00 00:00:00' ? $val['cont_time'] : '', + 'is_unlock' => $is_unlock ); } } diff --git a/admin/views/receiver/clues/lists.php b/admin/views/receiver/clues/lists.php index bcfd9224..92828d12 100644 --- a/admin/views/receiver/clues/lists.php +++ b/admin/views/receiver/clues/lists.php @@ -299,7 +299,10 @@
- + +
+ + 分配时间:
派单过期:
diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index 8359f9cd..f7000bae 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -258,7 +258,10 @@ {{v.admin_name}} {{v.brand_detail}} {{v.wxgr_name}} - {{v.status_name}} + + {{v.status_name}}
+ {{v.is_unlock}} + {{v.p_time}} {{v.cont_time}} diff --git a/agent/admin/controllers/api/home/Data.php b/agent/admin/controllers/api/home/Data.php index 25cb09dd..05fc0aa4 100644 --- a/agent/admin/controllers/api/home/Data.php +++ b/agent/admin/controllers/api/home/Data.php @@ -24,7 +24,7 @@ class Data extends BaseController $where['c_time>='] = strtotime(date('Y-m-d 00:00:00')); $where['c_time<='] = time(); $today_clues = $this->clues_model->count($where); - $member = $this->pingan_users_model->count(); + $member = $this->pingan_users_model->count(['status' => Pingan_users_model::STATUS_NORMAL]); $app_id = self::APP_ID; $where = [ "clue_id in (select id from lc_receiver_clues where app_id={$app_id})" => null diff --git a/agent/admin/controllers/pingan/car/Product.php b/agent/admin/controllers/pingan/car/Product.php index 3805e32d..f1ef368e 100644 --- a/agent/admin/controllers/pingan/car/Product.php +++ b/agent/admin/controllers/pingan/car/Product.php @@ -223,7 +223,7 @@ class Product extends BaseController } } if ($limit >= 10000) { - $columns = ['品牌', '车型', '官方售价', '补贴详情', '推广周期', '线索佣金', '订单佣金', '城市', '适用门店']; + $columns = ['代理人姓名', '代理人工号', '团队主管姓名', '团队主管工号', '部经理姓名', '部经理工号', '区经理姓名', '区经理工号', '中心编号','归属城市','归属机构','代理人角色编号']; } $data = ['list' => $list, 'count' => $count, 'columns' => $columns]; return $data; diff --git a/agent/admin/controllers/pingan/organization/User.php b/agent/admin/controllers/pingan/organization/User.php index bc57d8e5..f33166f8 100644 --- a/agent/admin/controllers/pingan/organization/User.php +++ b/agent/admin/controllers/pingan/organization/User.php @@ -20,75 +20,8 @@ class User extends BaseController public function page_get() { - $page = $this->input_param('page'); - $limit = $this->input_param('limit'); - $username = $this->input_param('username'); - $mobile = $this->input_param('mobile'); - $orgId = $this->input_param('orgId'); - $teamId = $this->input_param('teamId'); - $groupType = $this->input_param('groupType'); - $centerNumber = $this->input_param('centerNumber'); - $orgName = $this->input_param('orgName'); - $citys = $this->input_param('citys'); - $sort = $this->input_param('sort'); - $order = $this->input_param('order'); - $status = $this->input_param('status'); - !$page && $page = 1; - !$limit && $limit = 10; - $sort_order = 'id desc'; - if ($sort && $order) { - $sort_order = $sort . ' ' . $order; - } - $where = $list = []; - $where['status>='] = 0; - $username && $where["username like '%{$username}%'"] = null; - $mobile && $where["mobile like '%{$mobile}%'"] = null; - $orgId && $where['orgId'] = $orgId; - $teamId && $where['orgTeamId'] = $teamId; - $centerNumber && $where['centerNumber'] = $centerNumber; - strlen($groupType) && $where['groupType'] = $groupType; - $citys && $where['cityId'] = $citys[1]; - $orgName && $where['orgName'] = $orgName; - strlen($status) && $where['status'] = intval($status); - $count = $this->pinganUsers->count($where); - if ($count) { - $res = $this->pinganUsers->select($where, $sort_order, $page, $limit); - $orgId = array_column($res, 'orgId'); - $orgTeamId = array_column($res, 'orgTeamId'); - $orgIdArray = array_merge($orgId, $orgTeamId); - $orgMap = $this->mdOrganization->get_map_by_ids($orgIdArray, '', 'id', 'title'); - $areaIdArray = array_column($res, 'areaId'); - $depIdArray = array_column($res, 'depId'); - $teamIdArray = array_column($res, 'teamId'); - $userIdArray = array_merge($areaIdArray, $depIdArray, $teamIdArray); - $userIds = implode(',', $userIdArray); - $mapUsers = []; - if ($userIds) { - $where = ["id in ({$userIds})" => null]; - $mapUsers = $this->pinganUsers->map('id', '', $where, '', 0, 0, 'id,username,userCode'); - } - foreach ($res as $v) { - $status = intval($v['status']); -// $orgName = $orgMap[$v['orgId']] ?: ''; - $orgTeamName = $orgMap[$v['orgTeamId']] ?: ''; - $city = $this->area_model->get(['city_id' => $v['cityId']]); - $areaUser = $mapUsers[$v['areaId']] ? $mapUsers[$v['areaId']][0] : []; - $depUser = $mapUsers[$v['depId']] ? $mapUsers[$v['depId']][0] : []; - $teamUser = $mapUsers[$v['teamId']] ? $mapUsers[$v['teamId']][0] : []; - $list[] = [ - 'id' => $v['id'], 'mobile' => $v['mobile'], - 'username' => $v['username'], 'userCode' => $v['userCode'], - 'status' => $status, 'updateTime' => $v['updateTime'], - 'orgName' => $v['orgName'] ?: '', 'orgTeamName' => $orgTeamName, - 'typeCn' => Pingan_users_model::TYPE_CN[$v['groupType']], - 'groupType' => $v['groupType'], 'cityName' => $city['city_name'], - 'centerNumber' => Pingan_users_model::TYPE_CENTER[$v['centerNumber']], - 'areaUser' => $areaUser, 'depUser' => $depUser, 'teamUser' => $teamUser - ]; - } - } - $date = ['list' => $list, 'count' => $count]; - $this->return_response_list($date); + $data = $this->userList($this->input_param()); + $this->return_response_list($data); } public function groupType_get() @@ -404,6 +337,101 @@ class User extends BaseController } catch (Exception $e) { $this->return_json($e->getMessage()); } + } + public function export_get() + { + $this->inputs['page'] = 1; + $this->inputs['limit'] = 20000; + $data = $this->userList($this->inputs); + $this->return_response_list($data); + } + + private function userList($params) + { + $page = $params['page']; + $limit = $params['limit']; + $username = $params['username']; + $mobile = $params['mobile']; + $orgId = $params['orgId']; + $teamId = $params['teamId']; + $groupType = $params['groupType']; + $centerNumber = $params['centerNumber']; + $orgName = $params['orgName']; + $citys = $params['citys']; + $sort = $params['sort']; + $order = $params['order']; + $status = $params['status']; + !$page && $page = 1; + !$limit && $limit = 10; + $sort_order = 'id desc'; + if ($sort && $order) { + $sort_order = $sort . ' ' . $order; + } + $where = $list = []; + $where['status>='] = 0; + $username && $where["username like '%{$username}%'"] = null; + $mobile && $where["mobile like '%{$mobile}%'"] = null; + $orgId && $where['orgId'] = $orgId; + $teamId && $where['orgTeamId'] = $teamId; + $centerNumber && $where['centerNumber'] = $centerNumber; + strlen($groupType) && $where['groupType'] = $groupType; + $citys && $where['cityId'] = $citys[1]; + $orgName && $where['orgName'] = $orgName; + strlen($status) && $where['status'] = intval($status); + $count = $this->pinganUsers->count($where); + if ($count) { + $res = $this->pinganUsers->select($where, $sort_order, $page, $limit); + $orgId = array_column($res, 'orgId'); + $orgTeamId = array_column($res, 'orgTeamId'); + $orgIdArray = array_merge($orgId, $orgTeamId); + $orgMap = $this->mdOrganization->get_map_by_ids($orgIdArray, '', 'id', 'title'); + $areaIdArray = array_column($res, 'areaId'); + $depIdArray = array_column($res, 'depId'); + $teamIdArray = array_column($res, 'teamId'); + $userIdArray = array_merge($areaIdArray, $depIdArray, $teamIdArray); + $userIds = implode(',', $userIdArray); + $mapUsers = []; + if ($userIds) { + $where = ["id in ({$userIds})" => null]; + $mapUsers = $this->pinganUsers->map('id', '', $where, '', 0, 0, 'id,username,userCode'); + } + foreach ($res as $v) { + $orgTeamName = $orgMap[$v['orgTeamId']] ?: ''; + $city = $this->area_model->get(['city_id' => $v['cityId']]); + $areaUser = $mapUsers[$v['areaId']] ? $mapUsers[$v['areaId']][0] : []; + $depUser = $mapUsers[$v['depId']] ? $mapUsers[$v['depId']][0] : []; + $teamUser = $mapUsers[$v['teamId']] ? $mapUsers[$v['teamId']][0] : []; + if ($limit >= 10000) { //导出 + $list[] = [ + 'username' => $v['username'], 'userCode' => $v['userCode'], + 'areaUser' => $areaUser['username'] ?: '', 'areaUserCode' => $areaUser['userCode'] ?: '', + 'depUser' => $depUser['username'] ?: '', 'depUserCode' => $depUser['userCode'] ?: '', + 'teamUser' => $teamUser['username'] ?: '', 'teamUserCode' => $teamUser['userCode'] ?: '', + 'centerNumber' => Pingan_users_model::TYPE_CENTER[$v['centerNumber']], 'cityName' => $city['city_name'], + 'orgName' => $v['orgName'] ?: '', 'groupType' => $v['groupType'] + ]; + } else { + $status = intval($v['status']); +// $orgName = $orgMap[$v['orgId']] ?: ''; + $list[] = [ + 'id' => $v['id'], 'mobile' => $v['mobile'], + 'username' => $v['username'], 'userCode' => $v['userCode'], + 'status' => $status, 'updateTime' => $v['updateTime'], + 'orgName' => $v['orgName'] ?: '', 'orgTeamName' => $orgTeamName, + 'typeCn' => Pingan_users_model::TYPE_CN[$v['groupType']], + 'groupType' => $v['groupType'], 'cityName' => $city['city_name'], + 'centerNumber' => Pingan_users_model::TYPE_CENTER[$v['centerNumber']], + 'areaUser' => $areaUser, 'depUser' => $depUser, 'teamUser' => $teamUser + ]; + } + + } + } + $columns = []; + if ($limit >= 10000) { + $columns = ['代理人姓名', '代理人工号', '团队主管姓名', '团队主管工号', '部经理姓名', '部经理工号', '区经理姓名', '区经理工号', '中心编号', '归属城市', '归属机构', '代理人角色编号']; + } + return ['list' => $list, 'count' => $count, 'columns' => $columns]; } } \ No newline at end of file diff --git a/agent/admin/controllers/pingan/receiver/Customer.php b/agent/admin/controllers/pingan/receiver/Customer.php index 66b7d023..08424a1c 100644 --- a/agent/admin/controllers/pingan/receiver/Customer.php +++ b/agent/admin/controllers/pingan/receiver/Customer.php @@ -83,6 +83,7 @@ class Customer extends BaseController if ($orderSubsidy) { $checkStatus = Receiver_order_subsidy_model::IF_CHECK_STATUS[$orderSubsidy['ifcheck']] ?: ''; } + $isUnlock = $val['un_lock'] ? '已解锁' : '未解锁'; $temp = [ 'cluesSid' => $cluesRow['sid'], 'cid' => $val['cid'], @@ -95,7 +96,8 @@ class Customer extends BaseController 'brandDetail' => $brand_detail, 'belongUserName' => $pinganUsersRow ?: [], 'enTime' => date('Y-m-d H:i:s', $val['c_time']), - 'checkStatus' => $checkStatus + 'checkStatus' => $checkStatus, + 'isUnlock' => $isUnlock ]; $list[] = $temp; } @@ -297,6 +299,7 @@ class Customer extends BaseController $appId = self::APP_ID; $where = [ 'rid>' => 0, + 'un_lock' => Receiver_customers_model::LOCK_STATUS ]; if ($_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_TEAM || $_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_TEAM_CONTACT) { diff --git a/common/models/receiver/Receiver_customers_model.php b/common/models/receiver/Receiver_customers_model.php index 5995602d..751c43d2 100644 --- a/common/models/receiver/Receiver_customers_model.php +++ b/common/models/receiver/Receiver_customers_model.php @@ -18,6 +18,10 @@ class Receiver_customers_model extends HD_Model private $buy_time = [3 => '3天(H级)', 7 => '7天(A级)', 15 => '15天(B级)', 30 => '30天(C级)']; private $follow_channel = ['见面', '电话', '微信']; + //解锁状态 + const UNLOCK_STATUS = 0; //未解锁 + const LOCK_STATUS = 1; //已解锁 + public function __construct() { parent::__construct($this->table_name, 'default');