From fb149043ddd9b821ad12927b01c250d747d54f5d Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Thu, 13 Nov 2025 11:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E7=B4=A2=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=99=BB=E8=AE=B0=E5=92=8C=E8=B4=AD=E8=BD=A6=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/controllers/receiver/Clues.php | 38 +++++++++---------- .../controllers/pingan/receiver/Clues.php | 11 +++--- .../libraries/receiver/Customers_entity.php | 2 +- .../models/receiver/Receiver_clues_model.php | 4 +- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 2578c21e..e0bd2e63 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -76,7 +76,7 @@ class Clues extends HD_Controller $this->data['maintainAry'] = $this->maintainAry; $this->data['export_button'] = $export_button; $this->data['role'] = $this->role; - $this->data['levelList'] = $this->customers_model->get_sdata('level'); + $this->data['levelList'] = Receiver_clues_model::LEVEL_LIST; $this->data['_title'] = '线索池列表'; return $this->show_view('receiver/clues/lists', true); } @@ -143,6 +143,7 @@ class Clues extends HD_Controller $params['brand_id'] && $where['brand_id'] = $params['brand_id']; $params['series_id'] && $where['series_id'] = $params['series_id']; strlen($params['admin_id']) && $where['admin_id'] = $params['admin_id']; + $params['level'] && $where['level'] = $params['level']; //门店筛选 if ($params['biz_id_admin']) { @@ -162,9 +163,7 @@ class Clues extends HD_Controller !$params['brand_id'] && $params['brand_id'] = 0; !$params['series_id'] && $params['series_id'] = 0; !strlen($params['admin_id']) && $params['admin_id'] = ''; - if ($params['level']) { - $where["id in (select rid from lc_receiver_customers where `level` = '{$params['level']}')"] = null; - } + $params['level'] && $params['level'] = ''; $count = $this->clues_model->count($where); $lists = []; @@ -580,19 +579,19 @@ class Clues extends HD_Controller if (!$params['log']) { return $this->show_json(SYS_CODE_FAIL, '请输入内容!'); } - if (strlen($params['buy_time'])) { - $buy_time_cn = Receiver_clues_model::BUY_TIME_LIST[$params['buy_time']]; - $addData = array( - 'clue_id' => $params['id'], - 'uid' => $this->uid, - 'uname' => $this->username, - 'type' => intval($params['type']), - 'log' => '修改意向购车周期为:' . $buy_time_cn, - 'c_time' => time() - ); - $this->mdOplogs->add($addData); - $this->clues_model->update(['buy_time' => $params['buy_time']], ['id' => $params['id']]); - } +// if (strlen($params['buy_time'])) { +// $buy_time_cn = Receiver_clues_model::BUY_TIME_LIST[$params['buy_time']]; +// $addData = array( +// 'clue_id' => $params['id'], +// 'uid' => $this->uid, +// 'uname' => $this->username, +// 'type' => intval($params['type']), +// 'log' => '修改意向购车周期为:' . $buy_time_cn, +// 'c_time' => time() +// ); +// $this->mdOplogs->add($addData); +// $this->clues_model->update(['buy_time' => $params['buy_time']], ['id' => $params['id']]); +// } $addData = array( 'clue_id' => $params['id'], 'uid' => $this->uid, @@ -733,8 +732,9 @@ class Clues extends HD_Controller $up['cf_pid'] = $info['cf_pid']; } if ($info['buy_time'] != $re['buy_time']) { - $log .= '更新意向购车周期 '; + $log .= '修改意向购车周期为: ' . Receiver_clues_model::BUY_TIME_LIST[$info['buy_time']]; $up['buy_time'] = $info['buy_time']; + $up['level'] = Receiver_clues_model::LEVEL_LIST[$info['buy_time']] ?: Receiver_clues_model::LEVEL_DEFAULT; } $ret = $this->clues_model->update($up, array('id' => $info['id'])); @@ -1313,7 +1313,7 @@ class Clues extends HD_Controller 'county_id' => $biz['county_id'], 'mobile' => $re['mobile'], 'biz_id' => $item['biz_id'], - 'level' => 'H', + 'level' => $re['level'], 'cf_title' => '数字营销中台', 'of_id' => $re['cf_id'], 'of2_id' => $re['cf2_id'], diff --git a/agent/admin/controllers/pingan/receiver/Clues.php b/agent/admin/controllers/pingan/receiver/Clues.php index 6b4d9dfa..42c4f7e5 100644 --- a/agent/admin/controllers/pingan/receiver/Clues.php +++ b/agent/admin/controllers/pingan/receiver/Clues.php @@ -153,7 +153,7 @@ class Clues extends BaseController //搜索条件 public function search_get() { - $belongList = $statusList = []; + $statusList = []; $sList = $this->clues_model->statusAry(); foreach ($sList as $key => $value) { $statusList[] = [ @@ -162,7 +162,8 @@ class Clues extends BaseController ]; } $belongList = $this->pingan_users_model->levelListTree($_SESSION['id'], $_SESSION['groupType']); - $data = ['statusList' => $statusList, 'belongList' => $belongList]; + $levelList = Receiver_clues_model::LEVEL_LIST; + $data = ['statusList' => $statusList, 'belongList' => $belongList, 'levelList' => $levelList]; $this->return_response_list($data); } @@ -237,6 +238,7 @@ class Clues extends BaseController $userIds = $userIdArray ? implode(',', $userIdArray) : 0; $where['pingan_user_id in (' . $userIds . ')'] = null; } + $params['level'] && $where['level'] = $params['level']; return $where; } @@ -405,7 +407,7 @@ class Clues extends BaseController $status_name = $statusAry[$v['status']]['name']; $v['status2'] && $status_name .= '‒' . $statusAry[$v['status']]['list'][$v['status2']]; if ($limit >= 10000) { - $levelName = $unLockReason = $is_unlock = ''; + $unLockReason = $is_unlock = ''; if ($v['status'] == 1) { $unlockCustomer = $this->customers_model->get(['rid' => $v['id'], 'un_lock' => Receiver_customers_model::LOCK_STATUS]); $is_unlock = $unlockCustomer ? '已解锁' : '未解锁'; @@ -415,7 +417,6 @@ class Clues extends BaseController preg_match_all('/【(.*?)】/', $optLog[0]['log'], $matches); $unLockReason = $matches[1]; } - $levelName = $unlockCustomer['level']; } $temp = [ 'name' => $v['name'], 'mobile' => mobile_asterisk($v['mobile']), 'sid' => $v['sid'], @@ -429,7 +430,7 @@ class Clues extends BaseController 'subStatusCn' => $statusAry[$v['status']]['list'][$v['status2']] ?: '', 'isUnlock' => $is_unlock, 'unLockReason' => $unLockReason, - 'levelName' => $levelName, + 'levelName' => $v['level'], 'enTime' => $v['en_time'] ]; } else { diff --git a/common/libraries/receiver/Customers_entity.php b/common/libraries/receiver/Customers_entity.php index 50177761..8858e24a 100644 --- a/common/libraries/receiver/Customers_entity.php +++ b/common/libraries/receiver/Customers_entity.php @@ -8,7 +8,7 @@ class Customers_entity private $ci; - private $level = [3 => 'H', 7 => 'A', 15 => 'B', 30 => 'C']; + private $level = [7 => 'H', 15 => 'A', 30 => 'B', 90 => 'C', 120 => 'D']; public function __construct() { diff --git a/common/models/receiver/Receiver_clues_model.php b/common/models/receiver/Receiver_clues_model.php index 267257d8..622bbdc5 100644 --- a/common/models/receiver/Receiver_clues_model.php +++ b/common/models/receiver/Receiver_clues_model.php @@ -15,7 +15,9 @@ class Receiver_clues_model extends HD_Model const CF_ID2_PRODUCT = 40; // cf_id2 来源产品 //意向购车周期 // const BUY_TIME_LIST = [1 => '3天内', 2 => '一周内', 3 => '15天内', 4 => '1个月内', 5 => '超过1个月']; - const BUY_TIME_LIST = [1 => '7天内', 2 => '15天内', 3 => '一个月内', 4 => '三个月内', 5 => '三个月以上']; + const BUY_TIME_LIST = [7 => '7天内', 15 => '15天内', 30 => '一个月内', 90 => '三个月内', 120 => '三个月以上']; + const LEVEL_LIST = [7 => 'H', 15 => 'A', 30 => 'B', 90 => 'C', 120 => 'D']; + const LEVEL_DEFAULT = 'H';//默认等级 //分佣机构id const COMM_ORG_IDS = [1];