522 lines
24 KiB
PHP
522 lines
24 KiB
PHP
<?php
|
||
defined('BASEPATH') or exit('No direct script access allowed');
|
||
require_once APPPATH . 'controllers/pingan/BaseController.php';
|
||
|
||
class Clues extends BaseController
|
||
{
|
||
|
||
public function __construct()
|
||
{
|
||
parent::__construct();
|
||
$this->load->model('area_model');
|
||
$this->load->model('agent/pingan/pingan_users_model');
|
||
$this->load->model('agent/auto_product_model', 'autoProduct');
|
||
$this->load->model('receiver/receiver_clues_model', 'clues_model');
|
||
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
|
||
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
|
||
$this->load->model('auto/auto_brand_model');
|
||
$this->load->model('auto/auto_series_model');
|
||
$this->load->model('receiver/receiver_yx_model');
|
||
$this->load->model('receiver/receiver_xz_model');
|
||
$this->load->model('receiver/receiver_call_wechat_model');
|
||
$this->load->model('receiver/receiver_enroll_model');
|
||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||
$this->load->model('sys/sys_notice_model');
|
||
$this->clues_model->set_db('ssdb');
|
||
$this->clues_cfrom_model->set_db('ssdb');
|
||
$this->auto_brand_model->set_db('ssdb');
|
||
$this->auto_series_model->set_db('ssdb');
|
||
$this->mdOplogs->set_db('ssdb');
|
||
$this->receiver_yx_model->set_db('ssdb');
|
||
$this->receiver_xz_model->set_db('ssdb');
|
||
$this->receiver_call_wechat_model->set_db('ssdb');
|
||
$this->receiver_enroll_model->set_db('ssdb');
|
||
$this->customers_model->set_db('ssdb');
|
||
$this->sys_notice_model->set_db('ssdb');
|
||
$this->load->library('api/callPhone');
|
||
}
|
||
|
||
public function page_get()
|
||
{
|
||
$params = $this->input_param();
|
||
$data = $this->cluesList($params);
|
||
$this->return_response_list($data);
|
||
}
|
||
|
||
/**
|
||
* 详情
|
||
* @return void
|
||
*/
|
||
public function index_get()
|
||
{
|
||
$params = $this->input_param();
|
||
$id = intval($params['id']);
|
||
if (!$id) {
|
||
$this->return_json('非法参数!');
|
||
}
|
||
$re = $this->clues_model->get(array('id' => $id));
|
||
if (!$re || empty($re)) {
|
||
$this->return_json('线索不存在!');
|
||
}
|
||
$dataInfo = $re;
|
||
$dataInfo['mobile'] = mobile_asterisk($dataInfo['mobile']);
|
||
$dataInfo['c_time'] = date('Y-m-d H:i', $re['c_time']);
|
||
$selectedCar = ['brandId' => $re['brand_id'], 'seriesId' => $re['series_id'], 'modelId' => ''];
|
||
$dataInfo['selectedCar'] = $selectedCar;
|
||
$dataInfo['provinceCity'] = [$re['province_id'], $re['city_id'], $re['county_id']];
|
||
$cfRow = $this->clues_cfrom_model->get(['id' => $re['cf2_id']]);
|
||
$cfrom2 = $cfRow['title'] ?: '';
|
||
if ($re['cf2_id'] == self::CF2_PRODUCT) {
|
||
$product = $this->autoProduct->get(['id' => $re['out_id']]);
|
||
if ($product) {
|
||
$cfrom2 .= '-' . $product['title'];
|
||
}
|
||
};
|
||
|
||
$dataInfo['cfrom'] = $cfrom2;
|
||
$dataInfo['buyTimeList'] = Receiver_clues_model::BUY_TIME_LIST;
|
||
$users = $this->pingan_users_model->get(['id' => $re['pingan_user_id']], 'id,userCode,username,centerNumber,orgName');
|
||
$dataInfo['belongUser'] = $users ?: [];
|
||
$this->return_response($dataInfo);
|
||
}
|
||
|
||
/**
|
||
* 操作日志
|
||
* @return void
|
||
*/
|
||
public function opt_get()
|
||
{
|
||
$params = $this->input_param();
|
||
$page = $params['page'] ?: 1;
|
||
$limit = $params['limit'] ?: 10;
|
||
$list = [];
|
||
$params = $this->input_param();
|
||
$id = intval($params['id']);
|
||
if (!$id) {
|
||
$this->return_json('非法参数!');
|
||
}
|
||
$where = ['clue_id' => $id];
|
||
$count = $this->mdOplogs->count($where);
|
||
if ($count) {
|
||
$resLogs = $this->mdOplogs->select($where, 'c_time desc', $page, $limit);
|
||
foreach ($resLogs as $key => $value) {
|
||
$setValue = array();
|
||
$setValue['uname'] = $value['uname'];
|
||
$setValue['log'] = $value['log'];
|
||
$setValue['type_name'] = $this->mdOplogs->typeAry()[$value['type']];
|
||
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
|
||
list($rec_url, $rec_text) = $this->mdOplogs->getRecordUrl($value['id']);
|
||
$setValue['rec_url'] = $rec_url;
|
||
$setValue['rec_text'] = $rec_text;
|
||
$list[] = $setValue;
|
||
}
|
||
}
|
||
$data = ['list' => $list, 'count' => $count];
|
||
$this->return_response_list($data);
|
||
}
|
||
|
||
public function addLog_post()
|
||
{
|
||
$params = $this->input_param();
|
||
$clues = $this->clues_model->get(['id' => $params['id']]);
|
||
if (!$clues) {
|
||
$this->return_json('参数错误!');
|
||
}
|
||
if (!$params['content']) {
|
||
$this->return_json('请输入内容!');
|
||
}
|
||
if (strlen($params['buy_time'])) {
|
||
$buy_time_cn = Receiver_clues_model::BUY_TIME_LIST[$params['buy_time']];
|
||
$addData = array(
|
||
'clue_id' => $params['id'],
|
||
'pingan_user_id' => $_SESSION['id'],
|
||
'uname' => $_SESSION['username'],
|
||
'type' => intval($params['type']),
|
||
'log' => '修改意向购车周期为:' . $buy_time_cn,
|
||
'c_time' => time(),
|
||
'cf_platform' => Receiver_clue_oplogs_model::CF_PLATFORM_PINGAN_ADMIN
|
||
);
|
||
$this->mdOplogs->add($addData);
|
||
$this->clues_model->update(['buy_time' => $params['buy_time']], ['id' => $params['id']]);
|
||
}
|
||
$addData = array(
|
||
'clue_id' => $params['id'],
|
||
'pingan_user_id' => $_SESSION['id'],
|
||
'uname' => $_SESSION['username'],
|
||
'log' => $params['content'],
|
||
'c_time' => time(),
|
||
'cf_platform' => Receiver_clue_oplogs_model::CF_PLATFORM_PINGAN_ADMIN
|
||
);
|
||
$id = $this->mdOplogs->add($addData);
|
||
if ($id) {
|
||
//消息推送给管理后台
|
||
$admin_id = $clues['admin_id'];
|
||
if (!$admin_id) {
|
||
$where = [
|
||
'clue_id' => $clues['id'],
|
||
'uid>' => 0,
|
||
'cf_platform' => Receiver_clue_oplogs_model::CF_PLATFORM_ADMIN
|
||
];
|
||
$firstRow = $this->mdOplogs->select($where, 'id asc', 1, 1);
|
||
$admin_id = $firstRow ? $firstRow[0]['uid'] : 0;
|
||
}
|
||
if ($admin_id) {
|
||
$params = [
|
||
'platform' => Sys_notice_model::PLAT_FORM_ADMIN,
|
||
'uid' => $admin_id,
|
||
'content' => $addData['log'],
|
||
'url' => '/receiver/clues/get?id=' . $clues['id'],
|
||
];
|
||
$sendPlatform = Sys_notice_model::PLAT_FORM_SYS_PINGAN;
|
||
$this->sys_notice_model->addNotice($params, $sendPlatform, $_SESSION['id'], true);
|
||
}
|
||
$this->return_response();
|
||
} else {
|
||
$this->return_json('添加失败!');
|
||
}
|
||
}
|
||
|
||
//搜索条件
|
||
public function search_get()
|
||
{
|
||
$statusList = [];
|
||
$sList = $this->clues_model->statusAry();
|
||
foreach ($sList as $key => $value) {
|
||
$statusList[] = [
|
||
'value' => $key,
|
||
'label' => $value['name'],
|
||
];
|
||
}
|
||
$belongList = $this->pingan_users_model->levelListTree($_SESSION['id'], $_SESSION['groupType']);
|
||
$levelList = Receiver_clues_model::LEVEL_LIST;
|
||
$data = ['statusList' => $statusList, 'belongList' => $belongList, 'levelList' => $levelList];
|
||
$this->return_response_list($data);
|
||
}
|
||
|
||
private function buildWhere()
|
||
{
|
||
$params = $this->input_param();
|
||
$title = $this->input_param('title');
|
||
$sid = trim($this->input_param('sid'));
|
||
$brands = $this->input_param('brands');
|
||
$status = $this->input_param('status');
|
||
$citys = $this->input_param('citys');
|
||
// $belong = $this->input_param('belong');
|
||
$where = [
|
||
'app_id' => self::APP_ID,
|
||
'org_id' => $_SESSION['orgId']
|
||
];
|
||
if ($_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_TEAM
|
||
|| $_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_TEAM_CONTACT) {
|
||
$where['team_id'] = $_SESSION['id'];
|
||
} elseif ($_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_DEP) {
|
||
$where['dep_id'] = $_SESSION['id'];
|
||
} elseif ($_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_AREA) {
|
||
$where['area_id'] = $_SESSION['id'];
|
||
} elseif (in_array($_SESSION['groupType'],
|
||
[Pingan_users_model::GROUP_TYPE_ORG_CONTACT])) { //机构对接人
|
||
$orgName = $_SESSION['orgName'];
|
||
$areaUserIds = $this->pingan_users_model->select(['orgName' => $orgName, 'groupType' => Pingan_users_model::GROUP_TYPE_AREA], '', 0, 0, 'id');
|
||
$areaUserIdsString = implode(',', $areaUserIds);
|
||
!$areaUserIdsString && $areaUserIdsString = 0;
|
||
$where["area_id in ({$areaUserIdsString})"] = null;
|
||
} elseif ($_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_CENTER_CONTACT) { //中心对接人
|
||
$centerNumber = $_SESSION['centerNumber'];
|
||
$areaUserIds = $this->pingan_users_model->select(['centerNumber' => $centerNumber, 'groupType' => Pingan_users_model::GROUP_TYPE_AREA], '', 0, 0, 'id');
|
||
$areaUserIdsString = implode(',', $areaUserIds);
|
||
!$areaUserIdsString && $areaUserIdsString = 0;
|
||
$where["area_id in ({$areaUserIdsString})"] = null;
|
||
} elseif ($_SESSION['groupType'] == Pingan_users_model::GROUP_TYPE_ATTEND) {
|
||
$where['pingan_user_id'] = $_SESSION['id'];
|
||
} else { //其它角色看到所有数据
|
||
|
||
}
|
||
$title && $where['mobile LIKE "%' . trim($title) . '%"'] = null;
|
||
$sid && $where['sid LIKE "%' . trim($sid) . '%"'] = null;
|
||
if ($brands) {
|
||
$seriesIdArr = [];
|
||
foreach ($brands as $item) {
|
||
$itemArray = json_decode($item, true);
|
||
$itemArray[1] && $seriesIdArr[] = $itemArray[1];
|
||
}
|
||
$seriesIdString = implode(',', $seriesIdArr);
|
||
$seriesIdString && $where["series_id in ($seriesIdString)"] = null;
|
||
}
|
||
strlen($status) && $where['status'] = intval($status);
|
||
$citys && $where['city_id'] = $citys[1];
|
||
if ($params['dateRange'][0] && $params['dateRange'][1]) {
|
||
$where['en_time >='] = $params['dateRange'][0] . ' 00:00:00';
|
||
$where['en_time <='] = $params['dateRange'][1] . ' 23:59:59';
|
||
}
|
||
if ($params['userCode']) {
|
||
$user = $this->pingan_users_model->get(["userCode like '%{$params['userCode']}%'" => null], 'id');
|
||
!isset($where['pingan_user_id']) && $where['pingan_user_id'] = $user['id'] ?: 0;
|
||
}
|
||
if ($params['centerNumber']) {
|
||
$users = $this->pingan_users_model->select(['centerNumber' => $params['centerNumber'], 'status' => Pingan_users_model::STATUS_NORMAL], '', '', '', 'id');
|
||
$userIdArray = array_column($users, 'id');
|
||
$userIds = $userIdArray ? implode(',', $userIdArray) : 0;
|
||
$where['pingan_user_id in (' . $userIds . ')'] = null;
|
||
}
|
||
if ($params['orgName']) {
|
||
$users = $this->pingan_users_model->select(['orgName' => $params['orgName'], 'status' => Pingan_users_model::STATUS_NORMAL], '', '', '', 'id');
|
||
$userIdArray = array_column($users, 'id');
|
||
$userIds = $userIdArray ? implode(',', $userIdArray) : 0;
|
||
$where['pingan_user_id in (' . $userIds . ')'] = null;
|
||
}
|
||
$params['level'] && $where['level'] = $params['level'];
|
||
return $where;
|
||
}
|
||
|
||
/**
|
||
* 留资记录
|
||
* @return void
|
||
*/
|
||
public function enroll_get()
|
||
{
|
||
$params = $this->input_param();
|
||
$page = $params['page'] ?: 1;
|
||
$limit = $params['limit'] ?: 10;
|
||
$list = [];
|
||
$params = $this->input_param();
|
||
$id = intval($params['id']);
|
||
$clues = $this->clues_model->get(['id' => $id]);
|
||
if (!$clues) {
|
||
$this->return_json('非法参数!');
|
||
}
|
||
$where = ['mobile' => $clues['mobile']];
|
||
$count = $this->receiver_enroll_model->count($where);
|
||
if ($count) {
|
||
$rows = $this->receiver_enroll_model->select($where, 'id desc', $page, $limit);
|
||
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
|
||
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
|
||
foreach ($rows as $key => $value) {
|
||
$setValue = $value;
|
||
$setValue['mobile'] = mobile_asterisk($value['mobile']);
|
||
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
|
||
$brandName = $brands[$value['brand_id']] ? $brands[$value['brand_id']][0]['name'] : '';
|
||
$seriesName = $series[$value['series_id']] ? $series[$value['series_id']][0]['name'] : '';
|
||
$cfRow = $this->clues_cfrom_model->get(['id' => $value['cf2_id']]);
|
||
$cfrom2 = $cfRow['title'] ?: '';
|
||
if ($value['cf2_id'] == self::CF2_PRODUCT) {
|
||
$product = $this->autoProduct->get(['id' => $value['out_id']]);
|
||
if ($product) {
|
||
$cfrom2 .= '-' . $product['title'];
|
||
}
|
||
};
|
||
$setValue['brandName'] = "{$brandName} {$seriesName}";
|
||
$setValue['cfrom2'] = $cfrom2;
|
||
$list[] = $setValue;
|
||
}
|
||
}
|
||
$data = ['list' => $list, 'count' => $count];
|
||
$this->return_response_list($data);
|
||
}
|
||
|
||
public function index_put()
|
||
{
|
||
$params = $this->input_param();
|
||
if (!$params['name']) {
|
||
$this->return_json('请填写客户姓名!');
|
||
}
|
||
$row = $this->clues_model->get(['id' => $params['id']]);
|
||
if (!$row) {
|
||
$this->return_json('数据不存在!');
|
||
}
|
||
$provinceCity = $params['provinceCity'];
|
||
$update = [
|
||
'name' => $params['name'],
|
||
'province_id' => $provinceCity[0] ?: 0,
|
||
'city_id' => $provinceCity[1] ?: 0,
|
||
'county_id' => $provinceCity[2] ?: 0,
|
||
];
|
||
$result = $this->clues_model->update($update, ['id' => $row['id']]);
|
||
if (!$result) {
|
||
$this->return_json('保存失败!');
|
||
}
|
||
//添加日志
|
||
$log = '';
|
||
if ($update['name'] != $row['name']) {
|
||
$log .= '更新客户姓名 ';
|
||
}
|
||
if ($update['province_id'] != $row['province_id'] || $update['city_id'] != $row['city_id'] || $update['county_id'] != $row['county_id']) {
|
||
$log .= '更新客户所在地区 ';
|
||
}
|
||
if ($log) {
|
||
$addData = array(
|
||
'clue_id' => $row['id'],
|
||
'pingan_user_id' => $_SESSION['id'],
|
||
'uname' => $_SESSION['username'],
|
||
'type' => 0,
|
||
'log' => $log,
|
||
'c_time' => time(),
|
||
'cf_platform' => Receiver_clue_oplogs_model::CF_PLATFORM_PINGAN_ADMIN
|
||
);
|
||
$this->mdOplogs->add($addData);
|
||
}
|
||
$this->return_response();
|
||
}
|
||
|
||
/**
|
||
* 拨打电话
|
||
* @return void
|
||
*/
|
||
public function call_post()
|
||
{
|
||
$params = $this->input_param();
|
||
if (!$params['id']) {
|
||
$this->return_json('参数错误!');
|
||
}
|
||
$callPhone = new CallPhone();
|
||
$result = $callPhone->Call(Receiver_call_model::CF_TYPE_CLUE, $params['id'], $_SESSION['id'], $_SESSION['username'], $_SESSION['userCode']);
|
||
if (!$result->isSuccess()) {
|
||
$this->return_json($result->getMessage());
|
||
}
|
||
$this->return_response();
|
||
}
|
||
|
||
public function export_get()
|
||
{
|
||
$this->inputs['page'] = 1;
|
||
$this->inputs['limit'] = 20000;
|
||
$data = $this->cluesList($this->inputs);
|
||
$this->return_response_list($data);
|
||
}
|
||
|
||
private function cluesList($params)
|
||
{
|
||
$page = $params['page'] ?: 1;
|
||
$limit = $params['limit'] ?: 10;
|
||
$sort_order = 'id desc';
|
||
$statusList = $list = [];
|
||
$statusAry = $this->clues_model->statusAry();
|
||
foreach ($this->clues_model->statusAry() as $key => $value) {
|
||
$statusList[$key] = $value['name'];
|
||
}
|
||
$where = $this->buildWhere();
|
||
$count = $this->clues_model->count($where);
|
||
if ($count) {
|
||
$rows = $this->clues_model->select($where, $sort_order, $page, $limit);
|
||
$uIdArray = array_column($rows, 'pingan_user_id');
|
||
$teamIdArray = array_column($rows, 'team_id');
|
||
$userIdArray = array_merge($uIdArray, $teamIdArray);
|
||
$users = $this->pingan_users_model->get_map_by_ids($userIdArray, 'id,userCode,username,centerNumber,orgName');
|
||
//所在地区
|
||
$county_id_arr = array_filter(array_unique(array_column($rows, 'county_id')));
|
||
if ($county_id_arr) {
|
||
$str_ids = implode(',', $county_id_arr);
|
||
$map_area_county = $this->area_model->map('county_id', '', ["county_id in ({$str_ids})" => null], '', 0, 0, 'county_id,province_name,city_name,county_name');
|
||
}
|
||
|
||
$city_id_arr = array_filter(array_unique(array_column($rows, 'city_id')));
|
||
if ($city_id_arr) {
|
||
$str_ids = implode(',', $city_id_arr);
|
||
$map_area_city = $this->area_model->map('city_id', '', ["city_id in ({$str_ids})" => null], '', 0, 0, 'city_id,province_name,city_name');
|
||
}
|
||
|
||
$province_id_arr = array_filter(array_unique(array_column($rows, 'province_id')));
|
||
if ($province_id_arr) {
|
||
$str_ids = implode(',', $province_id_arr);
|
||
$map_area_province = $this->area_model->map('province_id', '', ["province_id in ({$str_ids})" => null], '', 0, 0, 'province_id,province_name');
|
||
}
|
||
foreach ($rows as $v) {
|
||
$belongUserName = $users[$v['pingan_user_id']] ? $users[$v['pingan_user_id']][0] : '';
|
||
$teamUser = $users[$v['team_id']] ? $users[$v['team_id']][0] : [];
|
||
$brandList = $this->receiver_enroll_model->getBrandsByMobile($v['mobile']);
|
||
$poi = '';
|
||
$area = '';
|
||
if ($v['county_id']) {
|
||
$area = $map_area_county[$v['county_id']][0];
|
||
$poi = "{$area['province_name']}-{$area['city_name']}";
|
||
} elseif ($v['city_id']) {
|
||
$area = $map_area_city[$v['city_id']][0];
|
||
$poi = "{$area['province_name']}-{$area['city_name']}";
|
||
} elseif ($v['province_id']) {
|
||
$area = $map_area_province[$v['province_id']][0];
|
||
$poi = "{$area['province_name']}";
|
||
}
|
||
$status_name = $statusAry[$v['status']]['name'];
|
||
$v['status2'] && $status_name .= '‒' . $statusAry[$v['status']]['list'][$v['status2']];
|
||
$unlockCustomer = $unLockReason = $is_unlock = '';
|
||
if ($v['status'] == 1) {
|
||
$unlockCustomer = $this->customers_model->get(['rid' => $v['id'], 'un_lock' => Receiver_customers_model::LOCK_STATUS]);
|
||
if (!$unlockCustomer) {
|
||
if ($this->customers_model->get(['rid' => $v['id'], 'un_lock' => Receiver_customers_model::LOCK_STATUS_2])) {
|
||
$is_unlock = '不解锁';
|
||
} else {
|
||
$is_unlock = '未解锁';
|
||
}
|
||
} else {
|
||
$is_unlock = '已解锁';
|
||
}
|
||
}
|
||
if ($limit >= 10000) {
|
||
if ($v['status'] == 1 && !$unlockCustomer) {
|
||
$optLog = $this->mdOplogs->select(['clue_id' => $v['id'], 'type' => Receiver_clue_oplogs_model::TYPE_UNLOCK], 'id desc', 1, 1, 'log');
|
||
$optLog && $unLockReason = $optLog[0]['log'];
|
||
if ($optLog) {
|
||
preg_match_all('/【(.*?)】/', $optLog[0]['log'], $matches);
|
||
$unLockReason = $matches[1];
|
||
}
|
||
}
|
||
$temp = [
|
||
'name' => $v['name'], 'mobile' => mobile_asterisk($v['mobile']), 'sid' => $v['sid'],
|
||
'belongUserName' => $belongUserName ? $belongUserName['username'] . '(' . $belongUserName['userCode'] . ')' : '',
|
||
'teamUser' => $teamUser['username'] ?: '',
|
||
'centerNumber' => $belongUserName['centerNumber'] ? Pingan_users_model::TYPE_CENTER[$belongUserName['centerNumber']] : '',
|
||
'orgName' => $belongUserName['orgName'] ?: '',
|
||
'brandList' => implode(',', $brandList),
|
||
'provinceName' => $area['province_name'] ?: '',
|
||
'cityName' => $area['city_name'] ?: '',
|
||
'statusCn' => $statusAry[$v['status']]['name'],
|
||
'subStatusCn' => $statusAry[$v['status']]['list'][$v['status2']] ?: '',
|
||
'isUnlock' => $is_unlock,
|
||
'unLockReason' => $unLockReason,
|
||
'levelName' => $v['level'],
|
||
'enTime' => $v['en_time']
|
||
];
|
||
} else {
|
||
$temp = [
|
||
'id' => $v['id'],
|
||
'sid' => $v['sid'],
|
||
'name' => $v['name'],
|
||
'mobile' => mobile_asterisk($v['mobile']),
|
||
'statusCn' => $status_name,
|
||
'enTime' => $v['en_time'],
|
||
'belongUserName' => $belongUserName,
|
||
'brandList' => $brandList,
|
||
'poi' => $poi,
|
||
'isUnlock' => $is_unlock,
|
||
'level' => $v['level'],
|
||
];
|
||
}
|
||
|
||
$list[] = $temp;
|
||
}
|
||
}
|
||
$columns = [];
|
||
if ($limit >= 10000) {
|
||
$columns = ['姓名', '手机号', '订单编号', '归属', '团队长', '中心', '机构', '关注车型', '所属省', '所属市', '主状态', '子状态', '是否解锁', '未解锁原因', '客户等级', '入池时间'];
|
||
}
|
||
return ['list' => $list, 'count' => $count, 'statusList' => $statusList, 'columns' => $columns];
|
||
}
|
||
|
||
/**
|
||
* 更新登记
|
||
* @return void
|
||
*/
|
||
public function level_post()
|
||
{
|
||
$params = $this->input_param();
|
||
if (!$params['id']) {
|
||
$this->return_json('参数错误!');
|
||
}
|
||
$res = $this->clues_model->update(['level' => $params['level']], ['id' => $params['id']]);
|
||
if (!$res) {
|
||
$this->return_json('更新失败!');
|
||
}
|
||
$this->return_response();
|
||
}
|
||
}
|
||
|