修改线索客户登记和购车时间

This commit is contained in:
lccsw
2025-11-13 11:41:55 +08:00
parent 0895a8ef69
commit fb149043dd
4 changed files with 29 additions and 26 deletions
+19 -19
View File
@@ -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'],
@@ -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 {
@@ -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()
{
@@ -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];