Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1813801a22 |
@@ -72,7 +72,6 @@ class Common extends CI_Controller
|
||||
$id = intval($this->input->get('id'));
|
||||
$url = $this->input->get('url');
|
||||
$type = intval($this->input->get('type'));
|
||||
$province_limit = $this->input->get('province_limit');
|
||||
$this->load->model('area_model');
|
||||
|
||||
switch ($key) {
|
||||
@@ -80,8 +79,7 @@ class Common extends CI_Controller
|
||||
if ($url == 'search') {
|
||||
$province = $this->filter($this->area_model->province());
|
||||
} else {
|
||||
$province_limit = $province_limit ? true : false;
|
||||
$province = $this->area_model->province($province_limit);
|
||||
$province = $this->area_model->province();
|
||||
}
|
||||
$this->data = $province;
|
||||
break;
|
||||
@@ -835,7 +833,6 @@ class Common extends CI_Controller
|
||||
public function bind_mobile()
|
||||
{
|
||||
$this->load->model('sys/sys_admin_model');
|
||||
$this->load->model('sys/sys_yx_mobiles_model');
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
$type = $params['type'];
|
||||
@@ -854,14 +851,12 @@ class Common extends CI_Controller
|
||||
return $this->show_json(SYS_CODE_FAIL, '手机不存在!');
|
||||
}
|
||||
$mobile = $re['mobile'];
|
||||
// $cache = &load_cache('redis');
|
||||
// $xz_admin_phone = $cache->get('xz_admin_phone');
|
||||
// $middleNumber = '';
|
||||
// if ($xz_admin_phone) {
|
||||
// $middleNumber = $xz_admin_phone['admins'][$this->uid];
|
||||
// }
|
||||
$yxMobiles = $this->sys_yx_mobiles_model->get(['admin_id' => $this->uid, 'status' => 1]);
|
||||
$middleNumber = $yxMobiles['mobile'] ?: '';
|
||||
$cache = &load_cache('redis');
|
||||
$xz_admin_phone = $cache->get('xz_admin_phone');
|
||||
$middleNumber = '';
|
||||
if ($xz_admin_phone) {
|
||||
$middleNumber = $xz_admin_phone['admins'][$this->uid];
|
||||
}
|
||||
if (!$middleNumber) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '还未分配号码不可使用');
|
||||
}
|
||||
@@ -1100,7 +1095,7 @@ class Common extends CI_Controller
|
||||
$count = $this->auto_brand_model->count($where);
|
||||
$itemsList = [];
|
||||
if ($count) {
|
||||
$lists = $this->auto_brand_model->select($where, 'initial asc', $page, $size);
|
||||
$lists = $this->auto_brand_model->select($where, 'id desc', $page, $size);
|
||||
foreach ($lists as $key => $val) {
|
||||
$itemsList[] = [
|
||||
'id' => $val['id'],
|
||||
@@ -1140,7 +1135,7 @@ class Common extends CI_Controller
|
||||
if ($type == 1) {
|
||||
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌');
|
||||
$res = array();
|
||||
$rows = $this->mdAutoBrand->select($where, 'initial asc', 0, 0, 'id,name');
|
||||
$rows = $this->mdAutoBrand->select($where, 'status desc, id asc', 0, 0, 'id,name');
|
||||
foreach ($rows as $v) {
|
||||
$res[] = array(
|
||||
'id' => strlen($status) > 0 ? $v['id'] : " " . $v['id'],
|
||||
@@ -1149,10 +1144,10 @@ class Common extends CI_Controller
|
||||
}
|
||||
} else if ($type == 2) {
|
||||
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系');
|
||||
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id asc', 0, 0, 'id,name');
|
||||
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id desc', 0, 0, 'id,name');
|
||||
} else if ($type == 3) {
|
||||
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车型');
|
||||
$res = $this->mdAutoCar->select(array_merge($where, ['series_id' => $pid]), 'id asc', 0, 0, 'id,name');
|
||||
$res = $this->mdAutoCar->select(array_merge($where, ['series_id' => $pid]), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
foreach ($res as $key => $value) {
|
||||
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
|
||||
@@ -1161,38 +1156,4 @@ class Common extends CI_Controller
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
public function auto_search()
|
||||
{
|
||||
$name = $this->input->get('name');
|
||||
$lists = [];
|
||||
|
||||
if ($name) {
|
||||
$where = array(
|
||||
"name like '%{$name}%'" => null,
|
||||
"status" => 1
|
||||
);
|
||||
|
||||
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
|
||||
$res = $this->mdAutoBrand->select($where, '', 0, 0, 'id,name');
|
||||
|
||||
foreach ($res as $value) {
|
||||
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->data = $lists;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
public function get_paic_users()
|
||||
{
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
$where = [
|
||||
'status' => App_paic_users_model::STATUS_NORMAL
|
||||
];
|
||||
$rows = $this->app_paic_users_model->select($where, 'id desc', 0, 0, 'id,name');
|
||||
$this->data = $rows;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,9 +140,7 @@ class Login extends CI_Controller
|
||||
$domain = implode('.', $domain);
|
||||
|
||||
$this->input->set_cookie(LOGIN_CODE_COOKIE, $this->encryption->encrypt(json_encode($code)), 60 * 5, $domain);
|
||||
// send_sms($mobile, $code);
|
||||
$content = "【理车宝】" . "您的验证码为:{$code},请勿泄露于他人!";
|
||||
b2m_send_sms($mobile,$content);
|
||||
send_sms($mobile, $code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,11 +216,10 @@ class Login extends CI_Controller
|
||||
//退出
|
||||
public function logout()
|
||||
{
|
||||
// $domain = explode('.', $_SERVER['HTTP_HOST']);
|
||||
// array_shift($domain);
|
||||
// $domain = implode('.', $domain);
|
||||
$http_host = explode(':', $_SERVER['HTTP_HOST']);
|
||||
$domain = $http_host[0];
|
||||
$domain = explode('.', $_SERVER['HTTP_HOST']);
|
||||
array_shift($domain);
|
||||
$domain = implode('.', $domain);
|
||||
|
||||
$this->input->set_cookie(LOGIN_COOKIE, '', 0, $domain);
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '注销成功', '/login');
|
||||
|
||||
@@ -33,7 +33,7 @@ class Brand extends HD_Controller
|
||||
}
|
||||
}
|
||||
$count = $this->auto_brand_model->count($where);
|
||||
$rows = $this->auto_brand_model->select($where, 'initial asc', $page, $size);
|
||||
$rows = $this->auto_brand_model->select($where, 'status desc, id desc', $page, $size);
|
||||
$status_arr = $this->auto_brand_model->get_status();
|
||||
$list = [];
|
||||
if ($rows) {
|
||||
|
||||
@@ -80,6 +80,7 @@ class Cars extends HD_Controller
|
||||
'brand' => $map_brand[$v['brand_id']],
|
||||
'series' => $map_series[$v['series_id']],
|
||||
'name' => $v['name'],
|
||||
'third_car_id' => $v['third_car_id'],
|
||||
'status' => $v['status'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,496 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Customer extends HD_Controller
|
||||
{
|
||||
private $cfrom = [1 => '空间站', 2 => '车卖场'];
|
||||
private $cfrom2 = [11 => '厦门', 12 => '海口', 13 => '长沙', 14 => '佛山', 15 => '贵阳'];
|
||||
//private $channel = [1 => '抖音直播', 2 => '其他'];
|
||||
private $push_status = ['0' => '未上传', '-1' => '上传失败'];
|
||||
private $dis_status = [0 => '未分发', 2 => '分发失败'];
|
||||
|
||||
private $pushAppKey = '0d14a33984239fd744fa47719de5f916';
|
||||
private $keySupplyBusinessId = '67';
|
||||
private $keyOutsidePvareaidId = '303556333';
|
||||
private $keyExt5 = '10477';
|
||||
|
||||
private $channel = array(
|
||||
'10477' => '初始渠道',
|
||||
'10489' => '厦门-郑子华',
|
||||
'10490' => '厦门-魏思雨',
|
||||
'10491' => '厦门-蔡文彬',
|
||||
'10492' => '厦门-李怀松',
|
||||
'10493' => '厦门-哪吒',
|
||||
'10494' => '厦门-古惟天',
|
||||
'10495' => '厦门-7',
|
||||
'10496' => '厦门-8',
|
||||
'10497' => '厦门-9',
|
||||
'10498' => '厦门-10',
|
||||
'10499' => '长沙-1',
|
||||
'10500' => '长沙-2',
|
||||
'10501' => '长沙-3',
|
||||
'10502' => '长沙-4',
|
||||
'10503' => '长沙-5',
|
||||
'10504' => '海口-1',
|
||||
'10505' => '海口-2',
|
||||
'10506' => '海口-3',
|
||||
'10507' => '佛山-1',
|
||||
'10508' => '佛山-2',
|
||||
'10509' => '佛山-3',
|
||||
'10510' => '贵阳-1',
|
||||
'10511' => '贵阳-2',
|
||||
'10512' => '贵阳-3',
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('autohome/autohome_customer_model');
|
||||
$this->load->model("area_model");
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model("auto/auto_brand_model");
|
||||
$this->load->model("auto/auto_series_model");
|
||||
|
||||
$this->load->helper('order');
|
||||
$this->load->library('mycurl');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
list($lists, $count) = $this->lists();
|
||||
|
||||
$this->data['province_id'] = intval($params['province_id']);
|
||||
$this->data['city_id'] = intval($params['city_id']);
|
||||
$this->data['provinces'] = $this->province_ary();
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['cfromAry'] = $this->cfrom;
|
||||
$this->data['channelAry'] = $this->channel;
|
||||
$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
|
||||
$this->data['_title'] = '线索列表';
|
||||
|
||||
return $this->show_view('autohome/lists', true);
|
||||
}
|
||||
|
||||
public function lists($push = false)
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$where = [];
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 30;
|
||||
|
||||
if (strlen($params['push_id'])) {
|
||||
switch ($params['push_id']){
|
||||
case '0':
|
||||
$where["push_id"] = 0;
|
||||
break;
|
||||
case '-1':
|
||||
$where["push_id"] = -1;
|
||||
break;
|
||||
default:
|
||||
$where["push_id not in ('0', '-1')"] = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($params['mobile']) {
|
||||
$where["mobile like '{$params['mobile']}'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["c_time >="] = $c_time[0] . ' 00:00:00';
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["c_time <="] = $c_time[1] . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
//上传时间
|
||||
if ($params['p_time']) {
|
||||
$p_time = explode(' ~ ', $params['p_time']);
|
||||
if ($p_time[0]) {
|
||||
$where["p_time >="] = $p_time[0] . ' 00:00:00';
|
||||
}
|
||||
if ($p_time[1]) {
|
||||
$where["p_time <="] = $p_time[1] . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
|
||||
$province_id = intval($params['province_id']);
|
||||
$city_id = intval($params['city_id']);
|
||||
$province_id && $where['province_id'] = $province_id;
|
||||
$city_id && $where['city_id'] = $city_id;
|
||||
|
||||
$params['channel'] && $where['channel'] = $params['channel'];
|
||||
$params['cfrom_id'] && $where['cfrom'] = $params['cfrom_id'];
|
||||
$params['cfrom_id2'] && $where['cfrom2'] = $params['cfrom_id2'];
|
||||
$params['brand_id'] && $where['brand_id'] = $params['brand_id'];
|
||||
$params['series_id'] && $where['series_id'] = $params['series_id'];
|
||||
|
||||
$count = $this->autohome_customer_model->count($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$rows = $this->autohome_customer_model->select($where, 'id desc', $page, $size);
|
||||
$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, $size, 'city_id,province_name,city_name');
|
||||
}
|
||||
|
||||
$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'));
|
||||
$map_biz = $this->biz_model->map('biz_name', 'id', ['status' => 1, 'province_id' => 350000], '', 0, 0, 'id,biz_name');
|
||||
|
||||
foreach ($rows as $val){
|
||||
$area = $map_area_city[$val['city_id']][0];
|
||||
$val['area_title'] = "{$area['province_name']}-{$area['city_name']}";
|
||||
$val['car_title'] = $brands[$val['brand_id']][0]['name']." ".$series[$val['series_id']][0]['name'];
|
||||
|
||||
if($val['cfrom'] == 1){
|
||||
$cf2 = $this->cfrom2[$val['cfrom2']];
|
||||
}else{
|
||||
$cf2 = $map_biz[$val['cfrom2']];
|
||||
}
|
||||
$val['cf_title'] = $this->cfrom[$val['cfrom']]." ".$cf2;
|
||||
$val['channel_id'] = $val['channel'];
|
||||
$val['channel'] = $this->channel[$val['channel']];
|
||||
$val['push_status'] = $this->push_status[$val['push_id']] ? $this->push_status[$val['push_id']] : '上传成功';
|
||||
$val['dis_status'] = $this->dis_status[$val['dis_status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
|
||||
return [$lists, $count];
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
$info = ['province_id' => 0];
|
||||
if ($id) {
|
||||
$info = $this->item_model->get(['id' => $id]);
|
||||
$info['src_img'] = build_qiniu_image_url($info['img']);
|
||||
}
|
||||
$this->data['provinces'] = $this->province_ary();
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = $id ? '编辑' : '新增';
|
||||
return $this->show_view('/receiver/items/edit', true);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$info = $this->input->post();
|
||||
$data = [
|
||||
'title' => $info['title'],
|
||||
's_time' => $info['s_time'],
|
||||
'e_time' => $info['e_time'],
|
||||
'img' => $info['img'],
|
||||
'province_id' => $info['province_id'],
|
||||
'descrip' => $info['descrip'],
|
||||
];
|
||||
$res = $this->item_model->add($data);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit()
|
||||
{
|
||||
$info = $this->input->post();
|
||||
$row = $this->item_model->get(['id' => $info['id']]);
|
||||
if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在');
|
||||
$up_data = [
|
||||
'title' => $info['title'],
|
||||
's_time' => $info['s_time'],
|
||||
'e_time' => $info['e_time'],
|
||||
'img' => $info['img'],
|
||||
'province_id' => $info['province_id'],
|
||||
'descrip' => $info['descrip'],
|
||||
];
|
||||
$res = $this->item_model->update($up_data, ['id' => $info['id']]);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function add_excel()
|
||||
{
|
||||
require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php';
|
||||
$res = $this->upload();
|
||||
if (!$res['code']) {
|
||||
return $this->show_json(0, $res['message']);
|
||||
}
|
||||
$file = $res['path'];
|
||||
if ($res['file_ext'] == '.xls') {
|
||||
$reader = \PHPExcel_IOFactory::createReader('Excel5'); // 读取 excel 文档
|
||||
} elseif ($res['file_ext'] == '.xlsx') {
|
||||
$reader = \PHPExcel_IOFactory::createReader('Excel2007'); // 读取 excel 文档
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '文件无法识别');
|
||||
}
|
||||
$PHPExcel = $reader->load($file); // 文档名称
|
||||
$objWorksheet = $PHPExcel->getActiveSheet();
|
||||
$rowCnt = $objWorksheet->getHighestRow(); //获取总行数
|
||||
if ($rowCnt > 800) {
|
||||
@unlink($file);
|
||||
return $this->show_json(0, '数据大于800请拆分多个表格导入');
|
||||
}
|
||||
$data = array();
|
||||
for ($_row = 2; $_row <= $rowCnt; $_row++) { //读取内容
|
||||
$data[] = array(
|
||||
'name' => $objWorksheet->getCell('A' . $_row)->getValue(),
|
||||
'mobile' => $objWorksheet->getCell('B' . $_row)->getValue(),
|
||||
'cfrom1' => $objWorksheet->getCell('C' . $_row)->getValue(),
|
||||
'cfrom2' => $objWorksheet->getCell('D' . $_row)->getValue(),
|
||||
'channel' => $objWorksheet->getCell('E' . $_row)->getValue(),
|
||||
'province_name' => $objWorksheet->getCell('F' . $_row)->getValue(),
|
||||
'city_name' => $objWorksheet->getCell('G' . $_row)->getValue(),
|
||||
'brand_id' => $objWorksheet->getCell('H' . $_row)->getValue(),
|
||||
'series_id' => $objWorksheet->getCell('I' . $_row)->getValue(),
|
||||
);
|
||||
}
|
||||
$done = $this->add_batch($data);
|
||||
@unlink($file);
|
||||
$this->data['load_num'] = count($data);
|
||||
$this->data['done'] = $done;
|
||||
return $this->show_json(SYS_CODE_SUCCESS, "成功导入{$done}条");
|
||||
}
|
||||
|
||||
public function add_batch($lists=array())
|
||||
{
|
||||
$done = 0;
|
||||
$adds = $map_province = $map_city = $map_county = $map_biz = [];
|
||||
$cfrom_f = array_flip($this->cfrom);
|
||||
$cfrom2_f = array_flip($this->cfrom2);
|
||||
$map_biz = $this->biz_model->map('biz_name', 'id', ['status' => 1, 'province_id' => 350000], '', 0, 0, 'id,biz_name');
|
||||
$fails = array();
|
||||
|
||||
foreach ($lists as $k => $v) {
|
||||
if (!$v['name']) {
|
||||
$fails[] = array('data' => $v, 'msg' => 'name is null');
|
||||
continue;
|
||||
}
|
||||
if (!mobile_valid($v['mobile'])) {
|
||||
$fails[] = array('data' => $v, 'msg' => 'mobile valid fail');
|
||||
continue;
|
||||
}
|
||||
if ($this->autohome_customer_model->count(['mobile' => $v['mobile']])) {
|
||||
$fails[] = array('data' => $v, 'msg' => 'mobile duplicate');
|
||||
continue;
|
||||
}
|
||||
|
||||
$cf_id = $cfrom_f[$v['cfrom1']];
|
||||
if($cf_id == 1){
|
||||
$cf2_id = $cfrom2_f[$v['cfrom2']];
|
||||
}else{
|
||||
$cf2_id = $map_biz[$v['cfrom2']];
|
||||
}
|
||||
|
||||
$province_name = $v['province_name'];
|
||||
$city_name = $v['city_name'];
|
||||
if($city_name){
|
||||
$city = $this->area_model->get(["city_name like '$city_name%'" => null]);
|
||||
if(!$city){
|
||||
$city = $this->area_model->get(["county_name like '$city_name%'" => null]);
|
||||
}
|
||||
|
||||
$city_id = $city['city_id'];
|
||||
$province_id = $city['province_id'];
|
||||
}
|
||||
|
||||
if(!$province_id){
|
||||
$province = $this->area_model->get(["province_name like '$province_name%'" => null]);
|
||||
$province_id = $province['province_id'];
|
||||
}
|
||||
|
||||
$temp = array(
|
||||
'sid' => create_customer_no(),
|
||||
'name' => $v['name'],
|
||||
'mobile' => $v['mobile'],
|
||||
'cfrom' => $cf_id ? $cf_id : 0,
|
||||
'cfrom2' => $cf2_id ? $cf2_id : 0,
|
||||
'channel' => $v['channel'] ? $v['channel'] : '',
|
||||
'brand_id' => $v['brand_id'] ? $v['brand_id'] : '',
|
||||
'series_id' => $v['series_id'] ? $v['series_id'] : '',
|
||||
'province_id' => $province_id,
|
||||
'city_id' => $city_id ? $city_id : 0,
|
||||
'c_time' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
|
||||
switch($v['city_name']){
|
||||
case '北京市':
|
||||
$temp['province_id'] = 110000;
|
||||
$temp['city_id'] = 110100;
|
||||
break;
|
||||
case '天津市':
|
||||
$temp['province_id'] = 120000;
|
||||
$temp['city_id'] = 120100;
|
||||
break;
|
||||
case '重庆市':
|
||||
$temp['province_id'] =500000;
|
||||
$temp['city_id'] = 500100;
|
||||
break;
|
||||
case '上海市':
|
||||
$temp['province_id'] = 310000;
|
||||
$temp['city_id'] = 310100;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$adds[] = $temp;
|
||||
$done++;
|
||||
}
|
||||
$fails && debug_log('[warning]# fails=' . json_encode($fails), __FUNCTION__, $this->log_dir);
|
||||
if ($adds) {
|
||||
$ret = $this->autohome_customer_model->add_batch($adds);
|
||||
if (!$ret) {
|
||||
debug_log("[error] add_batch fail; " . $this->autohome_customer_model->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||
$done = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $done;
|
||||
}
|
||||
|
||||
private function upload()
|
||||
{
|
||||
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/temp/';
|
||||
$config['allowed_types'] = 'xls|xlsx';
|
||||
$config['max_size'] = 5120;
|
||||
$config['file_name'] = 'receiver_clues' . time() . rand(1, 99999);
|
||||
$this->load->library('upload', $config);
|
||||
if (!$this->upload->do_upload('file')) {
|
||||
return array('code' => SYS_CODE_FAIL, 'message' => $this->upload->display_errors('', ''));
|
||||
} else {
|
||||
$data = $this->upload->data();
|
||||
return array('code' => SYS_CODE_SUCCESS, 'path' => $data['full_path'], 'file_ext' => $data['file_ext']);
|
||||
}
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function json_map_cfrom()
|
||||
{
|
||||
$pid = $this->input->post('pid');
|
||||
$map_biz = $this->biz_model->map('biz_name', 'id', ['status' => 1, 'province_id' => 350000, 'type' => 0], '', 0, 0, 'id,biz_name');
|
||||
|
||||
if($pid == 1){
|
||||
$this->data = $this->cfrom2;
|
||||
}else{
|
||||
$this->data = array_flip($map_biz);
|
||||
}
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
public function push_search(){
|
||||
$url = 'https://autoapi.autohome.com.cn/ggxt/xsyw/api/clues/push';
|
||||
list($lists, $count) = $this->lists(1);
|
||||
$succ = $fail = $undo = 0;
|
||||
|
||||
if($lists){
|
||||
foreach ($lists as $v){
|
||||
if($v['push_id']){
|
||||
$undo++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if($v['brand_id']){
|
||||
// $brand = $this->auto_brand_model->get(['id' => $v['brand_id']]);
|
||||
// $brand_id = $brand['ah_id'];
|
||||
// }
|
||||
//
|
||||
// if($v['series_id']){
|
||||
// $series = $this->auto_series_model->get(['id' => $v['series_id']]);
|
||||
// $series_id = $series['ah_id'];
|
||||
// }
|
||||
|
||||
$push_data = array(
|
||||
'pushAppKey' => $this->pushAppKey,
|
||||
'keySupplyBusinessId' => $this->keySupplyBusinessId,
|
||||
'keyOutsidePvareaidId' => $this->keyOutsidePvareaidId,
|
||||
'keyExt5' => $v['channel_id'],
|
||||
'keyExt12' => addslashes(json_encode(array('flowOrderNo' => $v['sid']))),
|
||||
'splitCode' => '123',
|
||||
'keyPrivateFlag' => '0',
|
||||
'keyTypeId' => '2',
|
||||
'keyOrderTime' => $v['c_time'],
|
||||
'keyOrderCityId' => $v['city_id'] ? $v['city_id'] : '110100',
|
||||
'keyName' => '客户'.$v['id'],
|
||||
'keyPhone' => $v['mobile'],
|
||||
'keyPurposeBrandId' => $v['brand_id'] ? $v['brand_id'] : null,
|
||||
'keyPurposeFactoryId' => null,
|
||||
'keyCarAudiId' => $v['series_id'] ? $v['series_id'] : null,
|
||||
'keyCarTypeId' => null,
|
||||
'keyCardCityId' => $v['city_id'] ? $v['city_id'] : '110100',
|
||||
'keyNewCarRentSupplierId' => 10
|
||||
);
|
||||
|
||||
$res = $this->mycurl->httpPost($url, $push_data, 'is_json');
|
||||
|
||||
if($res){
|
||||
$res = json_decode($res, true);
|
||||
if(!$res['status']){
|
||||
$up = array(
|
||||
'push_json' => json_encode($push_data),
|
||||
'push_id' => $res['result']['pushId'],
|
||||
'p_time' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$succ++;
|
||||
}else{
|
||||
$push_data['res'] = $res;
|
||||
$up = array(
|
||||
'push_json' => json_encode($push_data),
|
||||
'push_id' => -1,
|
||||
'p_time' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$fail++;
|
||||
}
|
||||
|
||||
$this->autohome_customer_model->update($up, array('id' => $v['id']));
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['succ'] = $succ;
|
||||
$this->data['fail'] = $fail;
|
||||
$this->data['undo'] = $undo;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_dis_status(){
|
||||
$url = 'https://autoapi.autohome.com.cn/pj-clues-handler/api/queryCluesInfo';
|
||||
|
||||
$push_data = array(
|
||||
'appKey' => $this->pushAppKey,
|
||||
'keySupplyBusinessId' => $this->keySupplyBusinessId,
|
||||
'pushIds' => '1728438233720721408',
|
||||
);
|
||||
|
||||
$res = $this->mycurl->httpPost($url, $push_data, 'is_json');
|
||||
if($res){
|
||||
print_r(json_encode($push_data));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,19 +64,16 @@ class Store extends HD_Controller
|
||||
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
$params['type'] && $where['type'] = $params['type'];
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
|
||||
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
|
||||
$count = $this->biz_model->count($where);
|
||||
$bizlists = [];
|
||||
foreach ($biz_lists as $v) {
|
||||
$v['c_time'] = date('Y-m-d H:i:s', $v['c_time']);
|
||||
$v['biz_type'] = $typeAry[$v['type']];
|
||||
$bizlists[] = $v;
|
||||
}
|
||||
$this->data['params'] = $params;
|
||||
$this->data['lists'] = $bizlists;
|
||||
$this->data['typeAry'] = $typeAry;
|
||||
$this->data['_title'] = '门店列表';
|
||||
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
|
||||
$this->show_view('biz/store/lists', true);
|
||||
@@ -85,7 +82,6 @@ class Store extends HD_Controller
|
||||
public function get()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
$this->data['typeAry'] = $this->biz_model->type_ary();
|
||||
$this->data['provinces'] = $this->province_ary();
|
||||
if ($id) {
|
||||
$biz = $this->biz_model->get(array('id' => $id, 'status>-1' => null));
|
||||
|
||||
@@ -8,8 +8,6 @@ class Clues extends HD_Controller
|
||||
protected $log_dir;
|
||||
private $maintainAry = ['0-0' => '待处理', '1-10' => '已加微信', '3-7' => '明确拒绝', '2-4' => '未接通', '2-5' => '未完整触碰'];//保养客户专用
|
||||
|
||||
private $role_id = 2;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -24,10 +22,6 @@ class Clues extends HD_Controller
|
||||
// $this->load->model('auto/auto_series_model', 'mdAutoSeries');
|
||||
// $this->load->model('auto/auto_attr_model', 'mdAutoAttr');
|
||||
$this->load->model('area_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
|
||||
$this->log_dir = 'receiver_clues';
|
||||
}
|
||||
|
||||
@@ -42,9 +36,6 @@ class Clues extends HD_Controller
|
||||
foreach ($this->clues_model->statusAry() as $key => $value) {
|
||||
$cate = array();
|
||||
$where = array("status" => $key);
|
||||
if ($this->admin_biz_str) {
|
||||
$where["biz_id in ($this->admin_biz_str)"] = null;
|
||||
}
|
||||
$count1 = $this->clues_model->count($where);
|
||||
if ($value['list']) {
|
||||
foreach ($value['list'] as $key2 => $value2) {
|
||||
@@ -56,7 +47,9 @@ class Clues extends HD_Controller
|
||||
$statusList[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
|
||||
}
|
||||
|
||||
$export_button = (SUPER_ADMIN == $this->role || $this->uid == 4) ? 1 : 0;
|
||||
if (!strlen($params['wxgr'])) {
|
||||
$params['wxgr'] = 1;
|
||||
}
|
||||
|
||||
$this->data['province_id'] = intval($params['province_id']);
|
||||
$this->data['city_id'] = intval($params['city_id']);
|
||||
@@ -69,7 +62,7 @@ class Clues extends HD_Controller
|
||||
$this->data['cfromAry2'] = $map_cfrom2;
|
||||
$this->data['statusList'] = $statusList;
|
||||
$this->data['maintainAry'] = $this->maintainAry;
|
||||
$this->data['export_button'] = $export_button;
|
||||
$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
|
||||
$this->data['_title'] = '线索池列表';
|
||||
return $this->show_view('receiver/clues/lists', true);
|
||||
}
|
||||
@@ -91,9 +84,6 @@ class Clues extends HD_Controller
|
||||
if ($params['title']) {
|
||||
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
if ($this->admin_biz_str) {
|
||||
$where["biz_id in ($this->admin_biz_str)"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
@@ -105,13 +95,13 @@ class Clues extends HD_Controller
|
||||
}
|
||||
}
|
||||
//最后报名时间
|
||||
if ($params['p_time']) {
|
||||
$en_time = explode(' ~ ', $params['p_time']);
|
||||
if ($params['en_time']) {
|
||||
$en_time = explode(' ~ ', $params['en_time']);
|
||||
if ($en_time[0]) {
|
||||
$where["p_time >="] = $en_time[0] . ' 00:00:00';
|
||||
$where["en_time >="] = $en_time[0] . ' 00:00:00';
|
||||
}
|
||||
if ($en_time[1]) {
|
||||
$where["p_time <="] = $en_time[1] . ' 23:59:59';
|
||||
$where["en_time <="] = $en_time[1] . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +111,7 @@ class Clues extends HD_Controller
|
||||
$where["status > "] = '-1';
|
||||
}
|
||||
|
||||
if (strlen($params['wxgr'])) {
|
||||
if (strlen($params['wxgr']) && $params['wxgr'] != 2) {
|
||||
$where["wxgr"] = $params['wxgr'];
|
||||
}
|
||||
|
||||
@@ -131,9 +121,6 @@ class Clues extends HD_Controller
|
||||
$county_id && $where['county_id'] = $county_id;
|
||||
$params['cfrom_id'] && $where['cf_id'] = $params['cfrom_id'];
|
||||
$params['cfrom_id2'] && $where['cf2_id'] = $params['cfrom_id2'];
|
||||
$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'];
|
||||
|
||||
//门店筛选
|
||||
if ($params['biz_id_admin']) {
|
||||
@@ -150,14 +137,11 @@ class Clues extends HD_Controller
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
!$params['brand_id'] && $params['brand_id'] = 0;
|
||||
!$params['series_id'] && $params['series_id'] = 0;
|
||||
!strlen($params['admin_id']) && $params['admin_id'] = '';
|
||||
|
||||
$count = $this->clues_model->count($where);
|
||||
$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';
|
||||
$fileds = 'id,name,mobile,cf_id,cf2_id,c_time,admin_id,status,status2,en_time,province_id,city_id,county_id,biz_id';
|
||||
$rows = $this->clues_model->select($where, 'en_time desc,id desc', $page, $size, $fileds);
|
||||
$map_admin = $map_cf_pid = $cf_title_arr = [];
|
||||
|
||||
@@ -194,7 +178,7 @@ class Clues extends HD_Controller
|
||||
$biz_id_arr && $biz_rows = $this->biz_model->map('id', 'id,biz_name,county_id', ["id in ({$str_ids})" => null], '', '', '', 'id,biz_name,county_id');
|
||||
|
||||
//门店位置
|
||||
$biz_rows && $county_id_bizarr = array_filter(array_unique(array_column($biz_rows, 'county_id')));
|
||||
$county_id_bizarr = array_filter(array_unique(array_column($biz_rows, 'county_id')));
|
||||
if ($county_id_bizarr) {
|
||||
$str_ids = implode(',', $county_id_bizarr);
|
||||
$map_area_biz = $this->area_model->map('county_id', '', ["county_id in ({$str_ids})" => null], '', 0, $size, 'county_id,province_name,city_name,county_name');
|
||||
@@ -218,10 +202,6 @@ class Clues extends HD_Controller
|
||||
$str_ids = implode(',', $province_id_arr);
|
||||
$map_area_province = $this->area_model->map('province_id', '', ["province_id in ({$str_ids})" => null], '', 0, $size, 'province_id,province_name');
|
||||
}
|
||||
|
||||
$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 => $val) {
|
||||
$val['cf_title'] = $cf_title_arr[$val['cf2_id']] ? $cf_title_arr[$val['cf2_id']] : $cf_title_arr[$val['cf_id']];
|
||||
|
||||
@@ -247,19 +227,9 @@ class Clues extends HD_Controller
|
||||
$bizarea = $map_area_biz[$biz_rows[$val['biz_id']]['county_id']][0];
|
||||
$val['biz_poi'] = "{$bizarea['province_name']}-{$bizarea['city_name']}-{$bizarea['county_name']}";
|
||||
|
||||
if ($brands[$val['brand_id']]) {
|
||||
$val['brand_detail'] = $brands[$val['brand_id']][0]['name'];
|
||||
$val['series_detail'] = $series[$val['series_id']][0]['name'];
|
||||
}
|
||||
if ($val['p_time'] == '0000-00-00 00:00:00') {
|
||||
$val['p_time'] = '';
|
||||
}
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$where = ['status' => 1, 'role_id' => $this->role_id];
|
||||
$adminLists = $this->sys_admin_model->select($where, 'id desc', 0, 0, 'id,username');
|
||||
$this->data['adminLists'] = $adminLists;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
|
||||
return [$lists, $count];
|
||||
@@ -395,12 +365,10 @@ class Clues extends HD_Controller
|
||||
'mobile' => '',
|
||||
'cf_id' => '',
|
||||
'cf2_id' => '',
|
||||
'province_id' => 350000,
|
||||
'province_id' => 0,
|
||||
'city_id' => 0,
|
||||
'county_id' => 0,
|
||||
'biz_id' => 0,
|
||||
'brand_id' => 0,
|
||||
'series_id' => 0,
|
||||
);
|
||||
$title = "新增线索";
|
||||
$action = "add";
|
||||
@@ -415,18 +383,18 @@ class Clues extends HD_Controller
|
||||
$this->data['action'] = $action;
|
||||
|
||||
$this->data['_title'] = $title;
|
||||
return $this->show_view('receiver/clues/get',true);
|
||||
return $this->show_view('receiver/clues/get');
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add()
|
||||
{
|
||||
$info = $this->input->post('info');
|
||||
if (!$info['name'] && !$info['sex']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请填写姓名或称谓');
|
||||
if (!$info['name']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请填写姓名');
|
||||
}
|
||||
|
||||
if (!mobile_valid($info['mobile']) && strlen($info['mobile']) != 14) {
|
||||
if (!mobile_valid($info['mobile'])) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '手机号码不准确');
|
||||
}
|
||||
|
||||
@@ -442,12 +410,10 @@ class Clues extends HD_Controller
|
||||
}
|
||||
|
||||
$add = array(
|
||||
'name' => $info['name'] . $info['sex'],
|
||||
'name' => $info['name'],
|
||||
'mobile' => $info['mobile'],
|
||||
'cf_id' => $info['cf_id'],
|
||||
'cf2_id' => $info['cf2_id'],
|
||||
'brand_id' => $info['brand_id'],
|
||||
'series_id' => $info['series_id'],
|
||||
'admin_id' => $this->uid,
|
||||
'c_time' => time(),
|
||||
'en_time' => date('Y-m-d H:i:s'),
|
||||
@@ -459,77 +425,10 @@ class Clues extends HD_Controller
|
||||
$info['biz_id'] && $add['status'] = 1;
|
||||
$info['biz_id'] && $add['status2'] = 1;
|
||||
$info['biz_id'] && $add['p_time'] = date('Y-m-d H:i:s');
|
||||
$info['cf_pid'] && $add['cf_pid'] = $info['cf_pid'];
|
||||
$ret = $this->clues_model->add($add);
|
||||
if ($ret) {
|
||||
$log = '新增线索';
|
||||
$this->addLog(array('clue_id' => $ret, 'type' => 3, 'log' => $log));
|
||||
|
||||
if ($info['text']) {
|
||||
$log = $info['text'];
|
||||
sleep(1);
|
||||
$this->addLog(array('clue_id' => $ret, 'type' => 0, 'log' => $log));
|
||||
}
|
||||
|
||||
if ($info['push'] && $info['biz_id']) {
|
||||
if ($this->customers_model->get(array('mobile' => $info['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))) {
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '门店已在跟踪';
|
||||
} else {
|
||||
$this->load->helper("order");
|
||||
$biz = $this->biz_model->get(array('id' => $info['biz_id']));
|
||||
$add = array(
|
||||
'rid' => $ret,
|
||||
'cid' => create_customer_no($biz['county_id']),
|
||||
'name' => $info['name'] . $info['sex'],
|
||||
'mobile' => $info['mobile'],
|
||||
'biz_id' => $info['biz_id'],
|
||||
'level' => 'H',
|
||||
'cf_title' => '数字营销中台',
|
||||
'of_id' => $info['cf_id'],
|
||||
'of2_id' => $info['cf2_id'],
|
||||
'brand_id' => $info['brand_id'],
|
||||
'series_id' => $info['series_id'],
|
||||
'p_time' => date('Y-m-d H:i:s'),
|
||||
'c_time' => time(),
|
||||
);
|
||||
|
||||
$info['province_id'] && $add['province_id'] = $info['province_id'];
|
||||
$info['city_id'] && $add['city_id'] = $info['city_id'];
|
||||
$info['county_id'] && $add['county_id'] = $info['county_id'];
|
||||
$info['cf_pid'] && $add['cf_pid'] = $info['cf_pid'];
|
||||
|
||||
$customers_id = $this->customers_model->add($add);
|
||||
if ($customers_id) {
|
||||
sleep(1);
|
||||
$this->addLog(array('clue_id' => $ret, 'type' => 3, 'log' => '转交门店跟进'));
|
||||
$this->clues_model->update(['status' => 1, 'status2' => 2], ['id' => $ret]);
|
||||
|
||||
//同步线索日志到客户日志
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$this->customers_entity->syn_clues($customers_id, $ret);
|
||||
|
||||
//短信通知店长
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$where = array('biz_id' => $info['biz_id'], 'status' => 1, 'group_id' => 2);
|
||||
$res_u = $this->app_licheb_users_model->select($where);
|
||||
if ($res_u) {
|
||||
foreach ($res_u as $v) {
|
||||
if ($info['biz_id'] != 1) {
|
||||
b2m_send_sms($v['mobile'], '【理车宝】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$code = SYS_CODE_SUCCESS;
|
||||
$msg = '转交成功';
|
||||
} else {
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '转交失败';
|
||||
}
|
||||
}
|
||||
return $this->show_json($code, $msg);
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '新增成功');
|
||||
} else {
|
||||
debug_log("[error]# add fail; " . $this->clues_model->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||
@@ -642,22 +541,14 @@ class Clues extends HD_Controller
|
||||
$log = '';
|
||||
$up = [];
|
||||
|
||||
if (!$info['cf2_id']) {
|
||||
if(!$info['cf2_id']){
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '修改用户信息失败';
|
||||
} else {
|
||||
}else{
|
||||
if ($info['name'] != $re['name']) {
|
||||
$log .= '更新客户姓名 ';
|
||||
$up['name'] = $info['name'];
|
||||
}
|
||||
if ($info['mobile'] != $re['mobile']) {
|
||||
$log .= '更新客户手机号 ';
|
||||
$up['mobile'] = $info['mobile'];
|
||||
|
||||
if ($this->clues_model->get(['mobile' => $info['mobile']])) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '线索已存在');
|
||||
}
|
||||
}
|
||||
if ($info['wxgr'] != $re['wxgr']) {
|
||||
$up['wxgr'] = $info['wxgr'];
|
||||
}
|
||||
@@ -673,14 +564,6 @@ class Clues extends HD_Controller
|
||||
$up['cf2_id'] = $info['cf2_id'];
|
||||
}
|
||||
|
||||
if ($info['brand_id'] != $re['brand_id'] || $info['series_id'] != $re['series_id']) {
|
||||
$log .= '更新客户关注车型 ';
|
||||
$up['brand_id'] = $info['brand_id'];
|
||||
$up['series_id'] = $info['series_id'];
|
||||
}
|
||||
if ($info['cf_pid'] != $re['cf_pid']) {
|
||||
$up['cf_pid'] = $info['cf_pid'];
|
||||
}
|
||||
$ret = $this->clues_model->update($up, array('id' => $info['id']));
|
||||
|
||||
if (!$ret) {
|
||||
@@ -697,10 +580,10 @@ class Clues extends HD_Controller
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '门店已有该线索';
|
||||
} else {
|
||||
if ($clue = $this->clues_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))) {
|
||||
if($clue = $this->clues_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))){
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '门店已派单';
|
||||
} else {
|
||||
}else{
|
||||
$up_data = [
|
||||
'biz_id' => $info['biz_id'],
|
||||
'status' => 1,
|
||||
@@ -713,8 +596,8 @@ class Clues extends HD_Controller
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '派单门店失败';
|
||||
} else {
|
||||
$msg = $info['editType'] == 3 ? '派单门店成功' : '改派门店成功';
|
||||
$log = $info['editType'] == 3 ? '派单门店' : '改派门店';
|
||||
$msg = $info['editType'] == 3 ? '派单门店成功' : '改派门店成功';
|
||||
$log = $info['editType'] == 3 ? '派单门店' : '改派门店';
|
||||
$this->addLog(array('clue_id' => $info['id'], 'type' => 3, 'log' => $log));
|
||||
}
|
||||
}
|
||||
@@ -739,18 +622,15 @@ class Clues extends HD_Controller
|
||||
'cf_title' => '数字营销中台',
|
||||
'of_id' => $re['cf_id'],
|
||||
'of2_id' => $re['cf2_id'],
|
||||
'brand_id' => $re['brand_id'],
|
||||
'series_id' => $re['series_id'],
|
||||
'p_time' => $re['p_time'],
|
||||
'cont_time' => $re['cont_time'],
|
||||
'cf_pid' => $re['cf_pid'],
|
||||
'c_time' => $re['c_time'],
|
||||
);
|
||||
|
||||
$customers_id = $this->customers_model->add($add);
|
||||
if ($customers_id) {
|
||||
$this->addLog(array('clue_id' => $re['id'], 'type' => 3, 'log' => '转交门店跟进'));
|
||||
$this->clues_model->update(['status' => 1, 'status2' => 2], ['id' => $re['id']]);
|
||||
$this->clues_model->update(['status' => 1, 'status2' => 1], ['id' => $re['id']]);
|
||||
|
||||
//同步线索日志到客户日志
|
||||
$this->load->library('receiver/customers_entity');
|
||||
@@ -759,13 +639,9 @@ class Clues extends HD_Controller
|
||||
//短信通知店长
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$where = array('biz_id' => $re['biz_id'], 'status' => 1, 'group_id' => 2);
|
||||
$res_u = $this->app_licheb_users_model->select($where);
|
||||
if ($res_u) {
|
||||
foreach ($res_u as $v) {
|
||||
if ($re['biz_id'] != 1) {
|
||||
b2m_send_sms($v['mobile'], '【理车宝】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
|
||||
}
|
||||
}
|
||||
$res_u = $this->app_licheb_users_model->get($where);
|
||||
if($re['biz_id'] != 1){
|
||||
b2m_send_sms($res_u['mobile'], '【理车宝】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
|
||||
}
|
||||
|
||||
$msg = '转交成功';
|
||||
@@ -832,17 +708,12 @@ class Clues extends HD_Controller
|
||||
'id' => 'ID',
|
||||
'name' => '客户姓名',
|
||||
'mobile' => '手机',
|
||||
'poi' => '所在地区',
|
||||
'cf_title' => "来源",
|
||||
'wxgr' => '是否添加微信',
|
||||
'biz_name' => '派单门店',
|
||||
'biz_poi' => '门店所在地区',
|
||||
'brand_detail' => '关注品牌',
|
||||
'series_detail' => '关注车型',
|
||||
'status_name' => '状态',
|
||||
'p_time' => '分配时间',
|
||||
'c_time' => '创建时间',
|
||||
'u_time' => '更新时间'
|
||||
];
|
||||
$data = [];
|
||||
if ($lists) {
|
||||
@@ -851,17 +722,12 @@ class Clues extends HD_Controller
|
||||
'id' => $val['id'],
|
||||
'name' => $val['name'],
|
||||
'mobile' => $val['mobile'],
|
||||
'poi' => $val['poi'],
|
||||
'cf_title' => $val['cf_title'],
|
||||
'wxgr' => $val['wxgr'] ? '是' : '否',
|
||||
'biz_name' => $val['biz_name'],
|
||||
'biz_poi' => $val['biz_poi'],
|
||||
'brand_detail' => $val['brand_detail'],
|
||||
'series_detail' => $val['series_detail'],
|
||||
'status_name' => $val['status_name'],
|
||||
'p_time' => $val['p_time'],
|
||||
'c_time' => date('Y-m-d H:i:s', $val['c_time']),
|
||||
'u_time' => $val['u_time']
|
||||
];
|
||||
$data[] = $item;
|
||||
}
|
||||
@@ -884,6 +750,9 @@ class Clues extends HD_Controller
|
||||
];
|
||||
$city_id && $where['city_id'] = $city_id;
|
||||
$county_id && $where['county_id'] = $county_id;
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',', array_keys($typeAry));
|
||||
$type_ids && $where["type in ($type_ids)"] = null;
|
||||
$bizList = $this->biz_model->select($where, '', '', '', 'id,biz_name');
|
||||
$this->data['bizList'] = $bizList;
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
@@ -933,8 +802,7 @@ class Clues extends HD_Controller
|
||||
'of2_id' => 37,
|
||||
'cf_id' => $clues_row['cf_id'],
|
||||
'p_time' => date('Y-m-d H:i:s'),
|
||||
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time']),
|
||||
'cf_pid' => $clues_row['cf_pid'],
|
||||
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time'])
|
||||
];
|
||||
$customers_id = $this->customers_model->add($add_data);
|
||||
if ($customers_id) {
|
||||
@@ -1078,7 +946,7 @@ class Clues extends HD_Controller
|
||||
$total = $this->clues_cfrom_model->count($where);
|
||||
$map = array();
|
||||
if ($total) {
|
||||
$orderby = 'sort desc';
|
||||
$orderby = 'id desc';
|
||||
$select = 'id, title';
|
||||
$rows = $this->clues_cfrom_model->select($where, $orderby, 0, 0, $select);
|
||||
foreach ($rows as $v) {
|
||||
@@ -1200,27 +1068,4 @@ class Clues extends HD_Controller
|
||||
$this->data['bizinfo'] = $bizinfo;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
//分配管理员
|
||||
public function edit_admins()
|
||||
{
|
||||
$ids = $this->input->get_post('ids');
|
||||
if ($this->input->method() == 'post') {
|
||||
$ids_array = explode(',', $ids);
|
||||
$admin_id = $this->input->post('admin_id');
|
||||
if (is_array($ids_array)) {
|
||||
foreach ($ids_array as $item) {
|
||||
$this->clues_model->update(['admin_id' => $admin_id, 'p_time' => date('Y-m-d H:i:s')], ['id' => $item]);
|
||||
}
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
$where = ['status' => 1, 'role_id' => $this->role_id];
|
||||
$adminLists = $this->sys_admin_model->select($where, 'id desc', 0, 0, 'id,username');
|
||||
$this->data['adminLists'] = $adminLists;
|
||||
$this->data['ids'] = $ids;
|
||||
return $this->show_view('receiver/clues/get_admin');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class CluesCfrom extends HD_Controller
|
||||
}
|
||||
|
||||
$re = $this->mdCluesCfrom->get(array('type' => 1, 'pid' => 0, "status" => 1));
|
||||
if ($re && $params['type'] == 1) {
|
||||
if ($re && $re['id'] != $params['id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店分类最多存在一个!');
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ class CluesCfrom extends HD_Controller
|
||||
}
|
||||
|
||||
$re = $this->mdCluesCfrom->get(array('type' => 1, 'pid' => 0, "status" => 1));
|
||||
if ($re && $re['id'] != $params['id'] && $params['type'] == 1) {
|
||||
if ($re && $re['id'] != $params['id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店分类最多存在一个!');
|
||||
}
|
||||
$this->mdCluesCfrom->update(['title' => $params['name'], 'type' => $params['type'],'sort' => $params['sort']], ['id' => $params['id']]);
|
||||
|
||||
@@ -10,7 +10,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class Customer extends HD_Controller
|
||||
{
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'cid' => '客户编号');
|
||||
private $searchTimeAry = array('p_time' => '派单/建档时间', 'cont_time' => '最后联系时间', 'dt_time' => '首次到店时间', 'order_time' => '下定时间', 'def_time' => '战败时间', 'c_time' => '创建时间',);
|
||||
private $searchTimeAry = array('p_time' => '派单/建档时间', 'cont_time' => '最后联系时间', 'dt_time' => '首次到店时间', 'order_time' => '下定时间', 'def_time' => '战败时间','c_time' => '创建时间', );
|
||||
|
||||
protected $log_dir;
|
||||
|
||||
@@ -24,13 +24,10 @@ class Customer extends HD_Controller
|
||||
$this->load->model('receiver/receiver_clues_model', 'clues_model');
|
||||
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
|
||||
$this->load->model('receiver/receiver_yx_model');
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model('area_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
|
||||
$this->log_dir = 'receiver_' . get_class($this);
|
||||
}
|
||||
@@ -48,7 +45,6 @@ class Customer extends HD_Controller
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
|
||||
$where = $this->get_where($params);
|
||||
$count = $this->customers_model->count($where);
|
||||
$lists = [];
|
||||
@@ -56,7 +52,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,cid,name,mobile,cf_title,p_time,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxgr,c_time,county_id';
|
||||
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
|
||||
//获取车管家
|
||||
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
|
||||
@@ -64,9 +60,6 @@ class Customer extends HD_Controller
|
||||
//获取门店
|
||||
$biz_id_arr = array_unique(array_column($rows, 'biz_id'));
|
||||
$biz_id_arr && $biz_rows = $this->biz_model->get_map_by_ids($biz_id_arr, 'id,biz_name,county_id');
|
||||
//车型
|
||||
$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 ($biz_rows as $v) {
|
||||
$county_id_arr[] = $v[0]['county_id'];
|
||||
@@ -100,27 +93,19 @@ class Customer extends HD_Controller
|
||||
$mobile_sub = $val['mobile'];
|
||||
$of_title = $cf_title_arr[$val['of2_id']] ? $cf_title_arr[$val['of2_id']] : $cf_title_arr[$val['of_id']];
|
||||
$area = $map_area[$biz_rows[$val['biz_id']][0]['county_id']][0];
|
||||
$brand_detail = '';
|
||||
if ($brands[$val['brand_id']]) {
|
||||
$brand_detail = $brands[$val['brand_id']][0]['name'];
|
||||
}
|
||||
if ($brands[$val['brand_id']]) {
|
||||
$brand_detail .= '-' . $series[$val['series_id']][0]['name'];
|
||||
}
|
||||
|
||||
$lists[] = array(
|
||||
'id' => $val['id'],
|
||||
'cid' => $val['cid'],
|
||||
'name' => $val['name'],
|
||||
'mobile' => $val['mobile'],
|
||||
'mobile_sub' => $this->get_mobile(['of_id' => $val['of_id'], 'mobile' => $mobile_sub]),
|
||||
'mobile_sub' => $mobile_sub,
|
||||
'level' => $val['level'],
|
||||
'of_title' => $of_title,
|
||||
'of_id' => $val['of_id'],
|
||||
'of2_id' => $val['of2_id'],
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'wxgr_name' => $wxgrAry[$val['wxgr']],
|
||||
'brand_detail' => $brand_detail,
|
||||
'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '',
|
||||
'biz_poi' => $area ? "{$area['province_name']}-{$area['city_name']}-{$area['county_name']}" : '',
|
||||
'biz_name' => isset($biz_rows[$val['biz_id']]) ? $biz_rows[$val['biz_id']][0]['biz_name'] : '',
|
||||
@@ -152,8 +137,7 @@ class Customer extends HD_Controller
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['qdjl_lists'] = $qdjl_lists;
|
||||
$this->data['provinces'] = $this->province_ary();
|
||||
//$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
|
||||
$this->data['export_button'] = 1;
|
||||
$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
|
||||
$this->data['_title'] = '客户列表';
|
||||
return $this->show_view('receiver/customer/lists', true);
|
||||
}
|
||||
@@ -444,9 +428,6 @@ class Customer extends HD_Controller
|
||||
!$params['tags'] && $params['tags'] = '';
|
||||
!$params['tagsIntention'] && $params['tagsIntention'] = '';
|
||||
!$params['tagsDefeat'] && $params['tagsDefeat'] = '';
|
||||
!$params['brand_id'] && $params['brand_id'] = 0;
|
||||
!$params['series_id'] && $params['series_id'] = 0;
|
||||
|
||||
$where = array('status>=0' => null);
|
||||
if ($_SESSION['admin_info']['biz_id']) {
|
||||
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
|
||||
@@ -464,11 +445,8 @@ class Customer extends HD_Controller
|
||||
if ($params['level']) {
|
||||
$where['level'] = $params['level'];
|
||||
}
|
||||
if ($params['brand_id']) {
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
}
|
||||
if ($params['series_id']) {
|
||||
$where['series_id'] = $params['series_id'];
|
||||
if (is_numeric($params['c_brand'])) {
|
||||
$where['c_brand'] = $params['c_brand'];
|
||||
}
|
||||
if ($params['of_id']) {
|
||||
$where['of_id'] = $params['of_id'];
|
||||
@@ -497,7 +475,6 @@ class Customer extends HD_Controller
|
||||
}
|
||||
!$params['search_tp'] && $params['search_tp'] = 'mobile';
|
||||
strlen($params['status']) && $where["status"] = $params['status'];
|
||||
!strlen($params['status']) && $params['status'] = '';
|
||||
if ($params['qdjl_id']) {
|
||||
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
|
||||
}
|
||||
@@ -570,9 +547,7 @@ class Customer extends HD_Controller
|
||||
$vdststus_parm = $vdststus ? " and lc_vd.status = {$vdststus}" : "";
|
||||
$where["id in(select lc_vd.c_id from lc_receiver_customer_visit_data lc_vd join lc_receiver_customer_visit_sales lc_vs on lc_vd.biz_id = lc_vs.biz_id and lc_vd.sales_id = lc_vs.sales_id and lc_vd.t_day = lc_vs.t_day and lc_vs.id = {$vsid} {$vdststus_parm})"] = null;
|
||||
}
|
||||
if ($this->admin_biz_str) {
|
||||
$where["biz_id in ($this->admin_biz_str)"] = null;
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
@@ -623,24 +598,12 @@ class Customer extends HD_Controller
|
||||
$area = $this->area_model->get(array('province_id' => $row['province_id']));
|
||||
$poi = "{$area['province_name']}";
|
||||
}
|
||||
$brand_detail = '';
|
||||
if ($row['brand_id']) {
|
||||
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']]);
|
||||
$brand && $brand_detail = $brand['name'];
|
||||
}
|
||||
if ($row['series_id']) {
|
||||
$series = $this->auto_series_model->get(['id' => $row['series_id']]);
|
||||
$series && $brand_detail .= '-' . $series['name'];
|
||||
}
|
||||
$paic_user = '';
|
||||
if ($row['cf_pid']) {
|
||||
$paic_user = $this->app_paic_users_model->get(['id' => $row['cf_pid']]);
|
||||
}
|
||||
|
||||
$info = array(
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'level' => $row['level'],
|
||||
'mobile' => $this->get_mobile(['of_id' => $row['of_id'], 'mobile' => $mobile_sub]),
|
||||
'mobile' => $mobile_sub,
|
||||
'of_title' => $of_title,
|
||||
'wx_name' => $this->customers_model->wxgrAry($row['wxgr']),
|
||||
'c_time' => date('Y-m-d H:i:s', $row['c_time']),
|
||||
@@ -652,9 +615,6 @@ class Customer extends HD_Controller
|
||||
'poi' => $poi,
|
||||
'biz' => $row_biz['biz_name'],
|
||||
'time_name' => $row['clue_id'] ? '派单时间' : '建档时间',
|
||||
'brand_detail' => $brand_detail,
|
||||
'role' => $this->role,
|
||||
'cf_name' => $paic_user ? $paic_user['name'] : ''
|
||||
);
|
||||
|
||||
//到店信息
|
||||
@@ -676,16 +636,9 @@ class Customer extends HD_Controller
|
||||
foreach ($rows_log as $key => $value) {
|
||||
$rec_text = $rec_url = '';
|
||||
if ($value['type'] == 2) {
|
||||
$record = '';
|
||||
if ($value['sub_type'] == Receiver_customer_oplogs_model::SUB_TYPE_XZ) {
|
||||
$rec_row = $this->receiver_xz_model->get(['id' => $value['log']], 'rec_url,duration');
|
||||
$rec_row['rec_url'] && $record = $rec_row['rec_url'];
|
||||
} else {
|
||||
$rec_row = $this->receiver_yx_model->get(['id' => $value['log']], 'rec_url,duration');
|
||||
$rec_row['rec_url'] && $record = get_yx_video($rec_row['rec_url']);
|
||||
}
|
||||
$rec_row = $this->receiver_yx_model->get(['id' => $value['log']], 'rec_url,duration');
|
||||
if ($rec_row['duration']) {
|
||||
$record && $rec_url = $record;
|
||||
$rec_row['rec_url'] && $rec_url = get_yx_video($rec_row['rec_url']);
|
||||
!$rec_row['rec_url'] && $rec_text = '录音暂未生成';
|
||||
} else {
|
||||
$rec_text = '未接通';
|
||||
@@ -954,7 +907,7 @@ class Customer extends HD_Controller
|
||||
#$where["cs_biz_id >= 0"] = null;
|
||||
$page = 1;
|
||||
$size = 10000;
|
||||
//$params['export_tag'] && $size = 500;
|
||||
$params['export_tag'] && $size = 500;
|
||||
|
||||
$indexs = [
|
||||
'id' => 'ID',
|
||||
@@ -975,9 +928,8 @@ class Customer extends HD_Controller
|
||||
"biz_name" => "归属门店",
|
||||
"admin_name" => "归属顾问",
|
||||
"wxgr_name" => "加个微",
|
||||
'brand_detail' => '关注品牌',
|
||||
'series_detail' => '关注车型'
|
||||
];
|
||||
|
||||
$count = $this->customers_model->count($where);
|
||||
$data = [];
|
||||
|
||||
@@ -985,12 +937,10 @@ class Customer extends HD_Controller
|
||||
$status_arr = $this->customers_model->get_status();
|
||||
unset($status_arr['-1']);
|
||||
if ($count) {
|
||||
$fileds = "id, name, mobile, level, status, cs_biz_id,brand_id,series_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, p_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, c_brand, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name";
|
||||
$fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, p_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, c_brand, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name";
|
||||
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
|
||||
$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 => $val) {
|
||||
$brand_detail = $series_detail = $of_title = '';
|
||||
$of_title = '';
|
||||
$of_title_1 = $of_title_2 = '';
|
||||
if ($val['of_id']) {
|
||||
$of_ary = $offlineSources[$val['of_id']];
|
||||
@@ -999,16 +949,11 @@ class Customer extends HD_Controller
|
||||
$val['of2_id'] && $of_title .= '-' . $of_ary['list'][$val['of2_id']];
|
||||
$val['of2_id'] && $of_ary['list'][$val['of2_id']] && $of_title_2 = $of_ary['list'][$val['of2_id']];
|
||||
}
|
||||
if ($brands[$val['brand_id']]) {
|
||||
$brand_detail = $brands[$val['brand_id']][0]['name'];
|
||||
$series_detail = $series[$val['series_id']][0]['name'];
|
||||
}
|
||||
|
||||
$id = $val['id'];
|
||||
$row = array(
|
||||
'id' => $id,
|
||||
'name' => $val['name'],
|
||||
'mobile' => $this->get_mobile(['of_id' => $val['of_id'], 'mobile' => $val['mobile']]),
|
||||
'mobile' => $val['mobile'],
|
||||
'level' => $val['level'],
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'city_name' => $val['city_name'],
|
||||
@@ -1024,8 +969,6 @@ class Customer extends HD_Controller
|
||||
'biz_name' => $val['biz_name'],
|
||||
'admin_name' => $val['admin_name'],
|
||||
'wxgr_name' => $this->customers_model->wxgrAry($val['wxgr']),
|
||||
'brand_detail' => $brand_detail,
|
||||
'series_detail' => $series_detail,
|
||||
);
|
||||
|
||||
if ($params['export_tag']) {
|
||||
@@ -1242,15 +1185,5 @@ class Customer extends HD_Controller
|
||||
return $show;
|
||||
}
|
||||
|
||||
private function get_mobile($params)
|
||||
{
|
||||
$mobile = $params['mobile'];
|
||||
if (!$mobile) {
|
||||
return '';
|
||||
} elseif (in_array($params['of_id'], [1, 2]) && $this->role == 8) {
|
||||
return mobile_asterisk($mobile);
|
||||
} else {
|
||||
return $mobile;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,39 +34,15 @@ class Orders extends HD_Controller
|
||||
$statusAry = $this->receiver_orders_model->get_status();
|
||||
$status_arr = array();
|
||||
foreach ($statusAry as $key => $value) {
|
||||
$where = ['status' => $key];
|
||||
if ($this->admin_biz_str) {
|
||||
$where["biz_id in ($this->admin_biz_str)"] = null;
|
||||
}
|
||||
$count = $this->receiver_orders_model->count($where);
|
||||
$count = $this->receiver_orders_model->count(['status' => $key]);
|
||||
$status_arr[] = array("id" => $key, "name" => $value, "cate" => [], "count" => $count);
|
||||
}
|
||||
$where = ['status>=' => 0];
|
||||
if($this->admin_biz_str){
|
||||
$where["biz_id in ($this->admin_biz_str)"] = null;
|
||||
}
|
||||
$params['count_all'] = $this->receiver_orders_model->count($where);//全部
|
||||
$params['count_all'] = $this->receiver_orders_model->count(['status>=' => 0]);//全部
|
||||
$params['list_type'] = 'all';
|
||||
if($this->admin_biz_str){
|
||||
$params['admin_biz_str'] = $this->admin_biz_str;
|
||||
}
|
||||
$result = $this->orderslist->lists($params['status_pid'], $params);
|
||||
$this->data = $result;
|
||||
//获取品牌
|
||||
$brand_rows = $this->auto_brand_model->select(['status>'=>0], 'initial asc', 0, 0, 'id,name');
|
||||
$brands = [];
|
||||
if($brand_rows){
|
||||
foreach ($brand_rows as $v) {
|
||||
$brands[] = array(
|
||||
'id' => $v['id'],
|
||||
'name' => $v['name'],
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->data['brands'] = $brands;
|
||||
$this->data['provinces'] = $this->province_ary();
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['cps_types'] = Receiver_orders_model::CPS_TYPES;
|
||||
$this->data['_title'] = '订单列表';
|
||||
return $this->show_view('receiver/order/lists', true);
|
||||
}
|
||||
@@ -277,7 +253,6 @@ class Orders extends HD_Controller
|
||||
$customers['of2_id'] && $of_title .= '-' . $of_ary['list'][$customers['of2_id']];
|
||||
$row['of_title'] = $of_title;
|
||||
}
|
||||
$row['p_time'] = date('Y-m-d', strtotime($customers['p_time']));
|
||||
$row['money_json'] = json_decode($row['money_json'], true);
|
||||
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
|
||||
$row['status'] = intval($row['status']);
|
||||
@@ -320,17 +295,8 @@ class Orders extends HD_Controller
|
||||
$img_data['car_auth_img'] && $img_data['car_auth_img'] = build_qiniu_image_url($img_data['car_auth_img']);
|
||||
$img_data['delivery_ck_img'] && $img_data['delivery_ck_img'] = build_qiniu_image_url($img_data['delivery_ck_img']);
|
||||
$img_data['bill_img'] && $img_data['bill_img'] = build_qiniu_image_url($img_data['bill_img']);
|
||||
|
||||
if($img_data['insurance_img']){
|
||||
$img_data['insurance_img'] = build_qiniu_image_url($img_data['insurance_img']);
|
||||
strstr($img_data['insurance_img'],'.pdf') && $img_data['insurance_pdf'] = $img_data['insurance_img'];
|
||||
}
|
||||
|
||||
if($img_data['business_img']){
|
||||
$img_data['business_img'] = build_qiniu_image_url($img_data['business_img']);
|
||||
strstr($img_data['business_img'],'.pdf') && $img_data['business_pdf'] = $img_data['business_img'];
|
||||
}
|
||||
|
||||
$img_data['insurance_img'] && $img_data['insurance_img'] = build_qiniu_image_url($img_data['insurance_img']);
|
||||
$img_data['business_img'] && $img_data['business_img'] = build_qiniu_image_url($img_data['business_img']);
|
||||
$row['img_data'] = $img_data;
|
||||
//获取销售员
|
||||
if ($row['sale_id']) {
|
||||
|
||||
@@ -1,303 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Report extends HD_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model("biz/biz_report_day_model");
|
||||
// $this->load->model('receiver/receiver_score_log_model');
|
||||
// $this->load->model('receiver/receiver_score_day_model');
|
||||
// $this->load->model('receiver/receiver_score_avg_day_model');
|
||||
// $this->load->model('app/licheb/app_licheb_users_model');
|
||||
// $this->load->model('receiver/receiver_customers_model');
|
||||
// $this->load->model('receiver/order/receiver_orders_model');
|
||||
// $this->load->model('receiver/order/receiver_order_datas_model');
|
||||
}
|
||||
|
||||
//首页信息
|
||||
public function index()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
|
||||
// $biz_where = ['status' => 1, 'type' => 0, 'province_id' => 350000];
|
||||
$biz_where = ['status' => 1, 'type in (1,2)' => null, 'province_id' => 350000];
|
||||
$biz_lists = $this->biz_model->select($biz_where, '', 0, 0, 'id,biz_name');
|
||||
$params['size'] = count($biz_lists) ?: 20;
|
||||
$lists = array();
|
||||
|
||||
$where = ["status<>-1" => null];
|
||||
if ($params['day']) {
|
||||
$where['day'] = $params['day'];
|
||||
} else {
|
||||
$where['day'] = date('Y-m-d', strtotime('yesterday'));
|
||||
}
|
||||
|
||||
if ($params['biz_id']) {
|
||||
$where['biz_id'] = $params['biz_id'];
|
||||
}
|
||||
$count = $this->biz_report_day_model->count($where);
|
||||
|
||||
$map_biz_lists = array_column($biz_lists, null, 'id');
|
||||
if ($count) {
|
||||
$res = $this->biz_report_day_model->select($where, "id desc", $params['page'], $params['size']);
|
||||
foreach ($res as $value) {
|
||||
$setValue = $value;
|
||||
$biz = $map_biz_lists[$value['biz_id']];
|
||||
$setValue['biz_name'] = $biz['biz_name'];
|
||||
$lists[] = $setValue;
|
||||
}
|
||||
}
|
||||
//获取所有
|
||||
$this->data['biz_lists'] = $biz_lists;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = '门店日报';
|
||||
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
|
||||
return $this->show_view('receiver/report/lists', true);
|
||||
}
|
||||
|
||||
//数据列表
|
||||
public function lists()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//展示单条数据
|
||||
public function get()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch()
|
||||
{
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$day = $params['day'];
|
||||
!$day && $day = date('Y-m-d', strtotime('yesterday'));
|
||||
|
||||
$indexs = [
|
||||
'biz_name' => '车卖场',
|
||||
'sales' => '顾问数(含店长)',
|
||||
'work_per' => '今日开工率',
|
||||
'cust_new' => '今日新增线索数',
|
||||
"cust_push" => "今日未及时分配数",
|
||||
'cust_visit' => '今日新增跟进数',
|
||||
"cust_delay" => "今日线索逾期数",
|
||||
"cust_defeat" => "今日战败申请未处理数",
|
||||
'order_new' => '今日订单新增数',
|
||||
"order_wrong" => "今日订单未达T+1",
|
||||
"order_early" => "今日开票早与订单时间数",
|
||||
'score' => '今日运营分',
|
||||
|
||||
'cust_month' => '本月线索总数',
|
||||
"cust_push_month" => "本月未及时分配总数",
|
||||
'cust_visit_month' => '本月跟进客户数',
|
||||
"cust_delay_month" => "本月线索逾期数",
|
||||
"cust_defeat_month" => "本月战败申请未处理数",
|
||||
'order_month' => '本月订单总数',
|
||||
"order_wrong_month" => "本月订单未达T+1",
|
||||
'order_over' => "本月交付总数",
|
||||
"order_finish" => "本月订单信息完整数",
|
||||
'score_month' => '本月运营分',
|
||||
];
|
||||
$lists = [];
|
||||
$where = ["status<>-1" => null];
|
||||
if ($params['day']) {
|
||||
$where['day'] = $params['day'];
|
||||
}
|
||||
if ($params['biz_id']) {
|
||||
$where['biz_id'] = $params['biz_id'];
|
||||
}
|
||||
$res = $this->biz_report_day_model->select($where, "id desc", $params['page'], $params['size']);
|
||||
$map_biz_lists = $this->biz_model->get_map_by_ids(array_column($res, 'biz_id'), 'id,biz_name');
|
||||
foreach ($res as $value) {
|
||||
$setValue = $value;
|
||||
$biz = $map_biz_lists[$value['biz_id']][0];
|
||||
$setValue['biz_name'] = $biz['biz_name'];
|
||||
$lists[] = $setValue;
|
||||
}
|
||||
$fileName = '车卖场日报';
|
||||
array_unshift($lists, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($lists, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
}
|
||||
//导出数据列表
|
||||
// public function export()
|
||||
// {
|
||||
// $day = $this->input->get('day');
|
||||
// !$day && $day = date('Y-m-d', strtotime('yesterday'));
|
||||
// $month = date('m', strtotime($day));
|
||||
//
|
||||
// $indexs = [
|
||||
// 'biz_name' => '车卖场',
|
||||
// 'sales' => '顾问数(含店长)',
|
||||
// 'work_per' => '今日开工率',
|
||||
// 'cust_new' => '今日新增线索数',
|
||||
// "cust_push" => "今日未及时分配数",
|
||||
// 'cust_visit' => '今日新增跟进数',
|
||||
// "cust_delay" => "今日线索逾期数",
|
||||
// "cust_defeat" => "今日战败申请未处理数",
|
||||
// 'order_new' => '今日订单新增数',
|
||||
// "order_wrong" => "今日订单未达T+1",
|
||||
// "order_early" => "今日开票早与订单时间数",
|
||||
// 'score' => '今日运营分',
|
||||
//
|
||||
// 'cust_month' => '本月线索总数',
|
||||
// "cust_push_month" => "本月未及时分配总数",
|
||||
// 'cust_visit_month' => '本月跟进客户数',
|
||||
// "cust_delay_month" => "本月线索逾期数",
|
||||
// "cust_defeat_month" => "本月战败申请未处理数",
|
||||
// 'order_month' => '本月订单总数',
|
||||
// "order_wrong_month" => "本月订单未达T+1",
|
||||
// 'order_over' => "本月交付总数",
|
||||
// "order_finish" => "本月订单信息完整数",
|
||||
// 'score_month' => '本月运营分',
|
||||
// ];
|
||||
//
|
||||
// $where = array(
|
||||
// 'status' => 1,
|
||||
// 'type' => 0,
|
||||
// 'province_id' => 350000
|
||||
// );
|
||||
// $bizs = $this->biz_model->select($where, '', 0, 0, 'id, biz_name');
|
||||
// if($bizs){
|
||||
// foreach ($bizs as $v){
|
||||
// //开工率
|
||||
// $sales = $this->app_licheb_users_model->count(array('group_id in (1,2)' => null, 'biz_id' => $v['id'], 'status' => 1));
|
||||
// $works = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 0, 'sub_type' => 0, 'score >' => 0));
|
||||
//
|
||||
// //今日新增线索数
|
||||
// $cust_new = $this->receiver_customers_model->count(array('biz_id' => $v['id'], 'DATE(p_time)' => $day));
|
||||
//
|
||||
// //本月线索总数
|
||||
// $cust_month = $this->receiver_customers_model->count(array('biz_id' => $v['id'], 'MONTH(p_time)' => $month));
|
||||
//
|
||||
// //今日新增跟进数
|
||||
// $cust_visit = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 1, 'sub_type' => 2, 'target_id >' => 0));
|
||||
//
|
||||
// //本月跟进客户数
|
||||
// $cust_visit_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 1, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //今日订单新增数
|
||||
// $order_new = $this->receiver_orders_model->count(array('DATE(order_time)' => $day, 'biz_id' => $v['id'], 'status >=' => 0));
|
||||
//
|
||||
// //本月订单总数
|
||||
// $order_month = $this->receiver_orders_model->select(array('MONTH(order_time)' => $month, 'biz_id' => $v['id'], 'status >=' => 0), '', 0, 0, 'id');
|
||||
//
|
||||
//
|
||||
// //本月订单信息完整数
|
||||
// if($order_month){
|
||||
// $oids = implode(',', array_unique(array_column($order_month, 'id')));
|
||||
//
|
||||
// $where = array(
|
||||
// "o_id in ({$oids})" => null,
|
||||
// "((cardida != '' AND cardidb != '') OR (business_licence != ''))" => null,
|
||||
// "pay_img <>" => '',
|
||||
// "contract_img <>" => '',
|
||||
// "bill_img <>" => '',
|
||||
// "car_img <>" => '',
|
||||
// "insurance_img <>" => '',
|
||||
// "business_img <>" => '',
|
||||
// );
|
||||
// $order_finish = $this->receiver_order_datas_model->count($where);
|
||||
// }else{
|
||||
// $order_finish = 0;
|
||||
// }
|
||||
//
|
||||
// //今日线索逾期数
|
||||
// $cust_delay = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 3, 'target_id >' => 0));
|
||||
//
|
||||
// //本月线索逾期数
|
||||
// $cust_delay_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 3, 'target_id >' => 0));
|
||||
//
|
||||
// //今日订单未达T+1
|
||||
// $order_wrong = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //本月订单未达T+1
|
||||
// $order_wrong_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //今日开票早与订单时间数
|
||||
// $order_early = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 1, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //今日未及时分配数
|
||||
// $cust_push = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 4, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //本月未及时分配数
|
||||
// $cust_push_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 4, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //今日战败申请未处理数
|
||||
// $cust_defeat = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 5, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //本月战败申请未处理数
|
||||
// $cust_defeat_moth = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 5, 'target_id >' => 0), 'target_id');
|
||||
//
|
||||
// //本月交付总数
|
||||
// $order_over = $this->receiver_orders_model->count(array('MONTH(over_time)' => $month, 'biz_id' => $v['id'], 'status >' => 0));
|
||||
//
|
||||
// //今日运营分
|
||||
// $score = $this->receiver_score_day_model->get(array('day' => $day, 'biz_id' => $v['id'], 'type' => 1));
|
||||
//
|
||||
// //本月运营分
|
||||
// $score_month = $this->receiver_score_avg_day_model->get(array('day' => $day, 'biz_id' => $v['id'], 'uid' => 0));
|
||||
//
|
||||
// $data[] = array(
|
||||
// 'biz_name' => $v['biz_name'],
|
||||
// 'sales' => $sales,
|
||||
// 'work_per' => number_format($works/$sales, 2) * 100 .'%',
|
||||
// 'cust_new' => $cust_new,
|
||||
// 'cust_push' => $cust_push,
|
||||
// 'cust_visit' => $cust_visit,
|
||||
// 'cust_delay' => $cust_delay,
|
||||
// 'cust_defeat' => $cust_defeat,
|
||||
// 'order_new' => $order_new,
|
||||
// 'order_wrong' => $order_wrong,
|
||||
// 'order_early' => $order_early,
|
||||
// 'score' => round($score['score']),
|
||||
//
|
||||
// 'cust_month' => $cust_month,
|
||||
// 'cust_push_month' => $cust_push_month,
|
||||
// 'cust_visit_month' => $cust_visit_month,
|
||||
// 'cust_delay_month' => $cust_delay_month,
|
||||
// 'cust_defeat_month' => $cust_defeat_moth,
|
||||
// 'order_month' => count($order_month),
|
||||
// 'order_wrong_month' => $order_wrong_month,
|
||||
// 'order_over' => $order_over,
|
||||
// 'order_finish' => $order_finish,
|
||||
// 'score_month' => round($score_month['score']),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $fileName = '车卖场日报';
|
||||
// array_unshift($data, $indexs);
|
||||
// $this->load->library('excel');
|
||||
// $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
// }
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Brand extends HD_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model("sys/sys_cps_model");
|
||||
$this->load->model("auto/auto_brand_model");
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return $this->lists();
|
||||
}
|
||||
|
||||
public function lists()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
!strlen($params['status']) && $params['status'] = '';
|
||||
!strlen($params['type']) && $params['type'] = '';
|
||||
$lists = array();
|
||||
$where = [];
|
||||
strlen($params['status']) && $where['status'] = intval($params['status']);
|
||||
strlen($params['type']) && $where['type'] = intval($params['type']);
|
||||
$status_lists = Sys_cps_model::STATUS_LISTS;
|
||||
$type_lists = Sys_cps_model::TYPES;
|
||||
$count = $this->sys_cps_model->count($where);
|
||||
if ($count) {
|
||||
$res = $this->sys_cps_model->select($where, "id desc", $params['page'], $params['size']);
|
||||
foreach ($res as $key => $value) {
|
||||
$brand = $this->auto_brand_model->get(['id' => $value['brand_id']]);
|
||||
$value['brand_name'] = $brand['name'];
|
||||
$value['type_name'] = Sys_cps_model::TYPES[$value['type']];
|
||||
$value['status_name'] = $status_lists[$value['status']];
|
||||
$lists[] = $value;
|
||||
}
|
||||
}
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['status_lists'] = $status_lists;
|
||||
$this->data['type_lists'] = $type_lists;
|
||||
$this->data['_title'] = 'cps列表';
|
||||
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
|
||||
$this->show_view('sys/cps/lists', true);
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
$info = ['brand_id' => '', 'type' => Sys_cps_model::TYPE_IMPORTANT];
|
||||
if ($id) {
|
||||
$info = $this->sys_cps_model->get(['id' => $id]);
|
||||
}
|
||||
$brand_rows = $this->auto_brand_model->select(['status' => 1], 'initial asc', 0, 0, 'id,name');
|
||||
$brands = [];
|
||||
if ($brand_rows) {
|
||||
foreach ($brand_rows as $v) {
|
||||
$brands[] = array(
|
||||
'id' => $v['id'],
|
||||
'name' => $v['name'],
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->data['brands'] = $brands;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['types'] = Sys_cps_model::TYPES;
|
||||
$this->data['_title'] = $id ? '编辑' : '新增';
|
||||
return $this->show_view('sys/cps/edit', true);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$info = $this->input->post();
|
||||
if (!$info['brand_id'] || !$info['type'] || !$info['s_time'] || !$info['e_time']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
$data = [
|
||||
'brand_id' => $info['brand_id'],
|
||||
'type' => $info['type'],
|
||||
's_time' => $info['s_time'],
|
||||
'e_time' => $info['e_time'],
|
||||
'c_time' => time()
|
||||
];
|
||||
$res = $this->sys_cps_model->add($data);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$info = $this->input->post();
|
||||
$row = $this->sys_cps_model->get(['id' => $info['id']]);
|
||||
if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在');
|
||||
$up_data = [
|
||||
'brand_id' => $info['brand_id'],
|
||||
'type' => $info['type'],
|
||||
's_time' => $info['s_time'],
|
||||
'e_time' => $info['e_time'],
|
||||
];
|
||||
$res = $this->sys_cps_model->update($up_data, ['id' => $info['id']]);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function batch()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function edit_status()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$row = $this->sys_cps_model->get(['id' => $id]);
|
||||
if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在');
|
||||
$status = $row['status'] ? 0 : 1;
|
||||
$up_data = [
|
||||
'status' => $status
|
||||
];
|
||||
$res = $this->sys_cps_model->update($up_data, ['id' => $id]);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Mobile extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('sys/sys_yx_mobiles_model');
|
||||
$this->load->model('area_model');
|
||||
$this->load->model('sys/sys_admin_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return $this->lists();
|
||||
}
|
||||
|
||||
public function lists($where = array(), $order = 'id desc', $page = 0, $size = 10)
|
||||
{
|
||||
$page = $this->input->post_get('page') ? $this->input->get('page') : 1;
|
||||
$params = $this->input->get();
|
||||
$where['status>='] = 0;
|
||||
if ($params['mobile']) {
|
||||
$where["mobile like '%{$params['mobile']}%'"] = null;
|
||||
}
|
||||
$count = $this->sys_yx_mobiles_model->count($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$rows = $this->sys_yx_mobiles_model->select($where, $order, $page, $size);
|
||||
foreach ($rows as $row) {
|
||||
$tmp = $row;
|
||||
$city = $this->area_model->get(['city_id' => $row['city_id']]);
|
||||
$tmp['province_name'] = $city['province_name'];
|
||||
$tmp['city_name'] = $city['city_name'];
|
||||
$admin = '';
|
||||
if ($row['admin_id']) {
|
||||
$admin = $this->sys_admin_model->get(['id' => $row['admin_id']]);
|
||||
}
|
||||
$tmp['admin_name'] = $admin ? $admin['username'] : '未绑定';
|
||||
$lists[] = $tmp;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => '', 'curr' => $page, 'totle' => $count, 'total' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = '云信虚拟号管理';
|
||||
$this->show_view('sys/yx/lists', true);
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$row = [];
|
||||
$url = 'add';
|
||||
if ($id) {
|
||||
$row = $this->sys_yx_mobiles_model->get(['id' => $id]);
|
||||
$url = 'edit';
|
||||
}
|
||||
$this->data['url'] = $url;
|
||||
$this->data['row'] = $row;
|
||||
$this->show_view('sys/yx/edit');
|
||||
}
|
||||
|
||||
|
||||
public function add()
|
||||
{
|
||||
$input = $this->input->post();
|
||||
if (!$input['mobile'] || !mobile_valid($input['mobile'])) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入正确手机号');
|
||||
}
|
||||
if (!$input['city_id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
|
||||
}
|
||||
$add = [
|
||||
'mobile' => $input['mobile'],
|
||||
'province_id' => $input['province_id'],
|
||||
'city_id' => $input['city_id'],
|
||||
'c_time' => time(),
|
||||
];
|
||||
$re = $this->sys_yx_mobiles_model->add($add);
|
||||
if ($re) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '添加失败');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$input = $this->input->post();
|
||||
$row = $this->sys_yx_mobiles_model->get(['id' => $input['id']]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
if (!$input['mobile'] || !mobile_valid($input['mobile'])) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入正确手机号');
|
||||
}
|
||||
if (!$input['city_id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
|
||||
}
|
||||
$data = [
|
||||
'mobile' => $input['mobile'],
|
||||
'province_id' => $input['province_id'],
|
||||
'city_id' => $input['city_id'],
|
||||
];
|
||||
$re = $this->sys_yx_mobiles_model->update($data, ['id' => $row['id']]);
|
||||
if ($re) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
}
|
||||
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @return bool
|
||||
*/
|
||||
public function edit_status()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '提交失败');
|
||||
}
|
||||
$status = $this->input->post('status');
|
||||
$update['status'] = $status;
|
||||
$re = $this->sys_yx_mobiles_model->update($update, array('id' => $id));
|
||||
if ($re) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '操作失败');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit_admin()
|
||||
{
|
||||
$id = $this->input->post_get('id');
|
||||
$row = $this->sys_yx_mobiles_model->get(['id' => $id]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
if ($this->input->method() == 'post') {
|
||||
$admin_id = (int)$this->input->post('admin_id');
|
||||
$re = $this->sys_yx_mobiles_model->update(['admin_id' => $admin_id], array('id' => $id));
|
||||
if ($re) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '操作失败');
|
||||
}
|
||||
} else {
|
||||
$where = [
|
||||
'status' => 1,
|
||||
"id not in (select admin_id from lc_sys_yx_mobiles where status>=0 and admin_id>0 and admin_id!={$row['admin_id']})" => null
|
||||
];
|
||||
$adminLists = $this->sys_admin_model->select($where, 'id desc', 0, 0, 'id,username,mobile');
|
||||
$this->data['adminLists'] = $adminLists;
|
||||
$this->data['row'] = $row;
|
||||
$this->show_view('sys/yx/edit_admin');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
abstract class HD_Controller extends CI_Controller
|
||||
{
|
||||
public $uid, $user_name, $role, $admin_biz, $admin_biz_str;
|
||||
public $uid, $user_name, $role;
|
||||
|
||||
public $data = array(), $if_ajax = false;
|
||||
|
||||
|
||||
+57
-46
@@ -6,11 +6,9 @@
|
||||
* Time: 14:10
|
||||
*/
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//session_start();
|
||||
|
||||
class Auth
|
||||
{
|
||||
class Auth {
|
||||
|
||||
public $uid, $username, $role;
|
||||
|
||||
@@ -28,7 +26,7 @@ class Auth
|
||||
$mth = $CI->router->fetch_method();
|
||||
$methods = explode('_', $mth);
|
||||
$action = action_node($methods[0]);
|
||||
$node = DIRECTORY_SEPARATOR . $dir . $ctrl;
|
||||
$node = DIRECTORY_SEPARATOR.$dir.$ctrl;
|
||||
$auth_match = array(1 => 'index', 2 => 'lists', 3 => 'get', 4 => 'add', 5 => 'edit', 6 => 'del', 7 => 'batch', 8 => 'export');
|
||||
$CI->load->model('sys/sys_admin_model');
|
||||
$CI->load->model('sys/sys_menu_model');
|
||||
@@ -36,18 +34,19 @@ class Auth
|
||||
$CI->load->model('sys/sys_city_model');
|
||||
$CI->load->model('Area_model');
|
||||
|
||||
if ($user_info = json_decode($user_info, true)) {
|
||||
if($user_info = json_decode($user_info, true))
|
||||
{
|
||||
//登录ip判断
|
||||
$admin_user = $CI->sys_admin_model->get(array('id' => $user_info['id']));
|
||||
$ip = get_client_ip();
|
||||
$ip_arr = array();
|
||||
if (SUPER_ADMIN == $admin_user['role_id']) {
|
||||
if(SUPER_ADMIN == $admin_user['role_id']){
|
||||
//超级管理员免检
|
||||
} else if ($this->is_ignore($user_info['id'])) {
|
||||
} else if($this->is_ignore($user_info['id'])){
|
||||
//免检
|
||||
} elseif (false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")) {
|
||||
} elseif(false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")){
|
||||
//开发测试免检
|
||||
} elseif (filter_var($ip, FILTER_VALIDATE_IP) && $ip != $admin_user['login_ip']) {
|
||||
} elseif(filter_var($ip, FILTER_VALIDATE_IP) && $ip != $admin_user['login_ip']) {
|
||||
// $CI->load->model('sys/sys_config_model');
|
||||
// $config_ip = $CI->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL,"k" => "site"));
|
||||
// $ip_arr = array();
|
||||
@@ -73,14 +72,14 @@ class Auth
|
||||
|
||||
//权限分类筛选
|
||||
$info = (array)json_decode($admin_user['other_json']);
|
||||
if ($admin_user['role_id'] == SUPER_ADMIN) {
|
||||
if($admin_user['role_id'] == SUPER_ADMIN) {
|
||||
$_SESSION['admin_role_id'] = '0';
|
||||
} else {
|
||||
if ($info['city_id']) {
|
||||
$province = $CI->Area_model->select(['city_id in ( ' . implode(',', $info['city_id']) . ')' => null]);
|
||||
if($info['city_id']) {
|
||||
$province = $CI->Area_model->select(['city_id in ( '.implode(',', $info['city_id']).')' => null]);
|
||||
$city = array_column($CI->sys_city_model->select(['status' => '0']), 'city_id');
|
||||
foreach ($info['city_id'] as $key => $value) {
|
||||
if (in_array($value, $city)) {
|
||||
if(in_array($value, $city)) {
|
||||
unset($info['city_id'][$key]);
|
||||
}
|
||||
}
|
||||
@@ -143,31 +142,40 @@ class Auth
|
||||
$role = $CI->sys_role_model->get(array('id' => $admin_user['role_id']));
|
||||
$action_json = $role['action_json'] ? json_decode($role['action_json'], true) : array();
|
||||
$menus = $CI->sys_menu_model->select(array("url like '" . $node . "%'" => null, 'status' => 1), "id ASC");
|
||||
foreach ($menus as $item) {
|
||||
foreach($menus as $item) {
|
||||
if (isset($action_json[$item['id']])) {
|
||||
$menu = $item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($admin_user['role_id'] != SUPER_ADMIN && $dir) {
|
||||
if (!$admin_user['status']) {
|
||||
if($admin_user['role_id'] != SUPER_ADMIN && $dir)
|
||||
{
|
||||
if(!$admin_user['status'])
|
||||
{
|
||||
return $this->returnMsg('您的账号已被禁用');
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu_ids = explode(',', $role['menu_ids']);
|
||||
|
||||
if (!$role['status']) {
|
||||
if(!$role['status'])
|
||||
{
|
||||
return $this->returnMsg('您的权限已被禁用');
|
||||
} elseif ('json' == $methods[0]) {
|
||||
} elseif('json' == $methods[0]){
|
||||
//弹框等公共搜索使用,无需菜单权限校验
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/*edit by xuxianbin 20190521 同一个url有可能对应多个节点*/
|
||||
// $menu = $CI->sys_menu_model->get(array("url like '" . $node . "%'" => null, 'status' => 1));
|
||||
if (!$action_json[$menu['id']]) {
|
||||
if(!$action_json[$menu['id']])
|
||||
{
|
||||
return $this->returnMsg('系统菜单尚未创建');
|
||||
}
|
||||
|
||||
if (!in_array($action, $action_json[$menu['id']])) {
|
||||
if(!in_array($action, $action_json[$menu['id']]))
|
||||
{
|
||||
return $this->returnMsg('您的权限不足');
|
||||
}
|
||||
}
|
||||
@@ -175,20 +183,26 @@ class Auth
|
||||
}
|
||||
|
||||
|
||||
if ($spm) {
|
||||
if($spm)
|
||||
{
|
||||
$spm_arr = explode('-', $spm);
|
||||
if (!$menu_ids) {
|
||||
if(!$menu_ids)
|
||||
{
|
||||
$role = $CI->sys_role_model->get(array('id' => $admin_user['role_id']));
|
||||
$menu_ids = explode(',', $role['menu_ids']);
|
||||
}
|
||||
|
||||
if (count($spm_arr) >= 5) {
|
||||
if(count($spm_arr) >= 5)
|
||||
{
|
||||
$four = $CI->sys_menu_model->select(array('pid' => $spm_arr[3], 'status' => 1), 'sort desc');
|
||||
if ($four) {
|
||||
if($four)
|
||||
{
|
||||
$arr = $spm_arr;
|
||||
|
||||
foreach ($four as $v) {
|
||||
if ($admin_user['role_id'] != SUPER_ADMIN && !in_array($v['id'], $menu_ids)) {
|
||||
foreach ($four as $v)
|
||||
{
|
||||
if($admin_user['role_id'] != SUPER_ADMIN && !in_array($v['id'], $menu_ids))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -208,14 +222,14 @@ class Auth
|
||||
//获取面包屑
|
||||
$spm_arr1 = explode('-', $menu['node']);
|
||||
$spm_arr1 && !is_numeric($spm_arr1[0]) && $spm_arr1 = array_slice($spm_arr1, 1);
|
||||
if ($spm_arr1) {
|
||||
$rows = $CI->sys_menu_model->select(array("id in (" . implode(",", $spm_arr1) . ")" => null, 'status' => 1), 'sort desc');
|
||||
if($spm_arr1){
|
||||
$rows = $CI->sys_menu_model->select(array("id in (" . implode(",",$spm_arr1) . ")" => null, 'status' => 1), 'sort desc');
|
||||
$menu_arr = array();
|
||||
$breads = array();
|
||||
foreach ($rows as $row) {
|
||||
foreach($rows as $row){
|
||||
$menu_arr[$row['id']] = $row;
|
||||
}
|
||||
foreach ($spm_arr1 as $v) {
|
||||
foreach($spm_arr1 as $v){
|
||||
$item = $menu_arr[$v];
|
||||
$breads[] = array(
|
||||
'spm' => $item['node'],
|
||||
@@ -232,10 +246,9 @@ class Auth
|
||||
$CI->uid = $admin_user ? $admin_user['id'] : 0;
|
||||
$CI->username = $admin_user ? $admin_user['username'] : '';
|
||||
$CI->role = $admin_user ? $admin_user['role_id'] : 0;
|
||||
$other_json = $admin_user['other_json'] ? json_decode($admin_user['other_json'], true) : [];
|
||||
$CI->admin_biz = $other_json['biz_id'] ? $other_json['biz_id'] : [];
|
||||
$CI->admin_biz_str = $CI->admin_biz ? implode(',', $CI->admin_biz) : '';
|
||||
} elseif ($ctrl != 'login') {
|
||||
}
|
||||
elseif($ctrl != 'login')
|
||||
{
|
||||
header('location:/login');
|
||||
}
|
||||
|
||||
@@ -245,24 +258,23 @@ class Auth
|
||||
/**
|
||||
* 初始化app参数
|
||||
*/
|
||||
public function initapp()
|
||||
{
|
||||
public function initapp(){
|
||||
$Input = &load_class("Input", "core");
|
||||
$Config = &load_class('Config', 'core');
|
||||
$key_cookie = "hd_app_id";
|
||||
$app_id = $Input->get_post("app_id");
|
||||
if (!$app_id) {
|
||||
if(!$app_id){
|
||||
$app_id = $Input->cookie($key_cookie);
|
||||
}
|
||||
|
||||
if ($app_id) {
|
||||
if($app_id){
|
||||
$Input->set_cookie($key_cookie, $app_id, time() + 86400);
|
||||
|
||||
$Config->load('app', true, true);
|
||||
$configs = $Config->item('app');
|
||||
$config = $configs[$app_id];
|
||||
//根据应用加载库
|
||||
if ($config['db']) {
|
||||
if($config['db']){
|
||||
$GLOBALS['app_db'] = $config['db'];
|
||||
}
|
||||
}
|
||||
@@ -280,16 +292,15 @@ class Auth
|
||||
* @param $admin_id
|
||||
* @return bool
|
||||
*/
|
||||
private function is_ignore($admin_id)
|
||||
{
|
||||
private function is_ignore($admin_id){
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('sys/sys_config_model', 'config_model');
|
||||
|
||||
$where = array('k' => 'igadmin', 'v LIKE \'%"admin_id":"' . $admin_id . '"%\'' => null);
|
||||
$where = array('k' => 'igadmin', 'v LIKE \'%"admin_id":"' .$admin_id. '"%\'' => null);
|
||||
$exist = $CI->config_model->get($where);
|
||||
if ($exist) {
|
||||
if($exist){
|
||||
$json = json_decode($exist['v'], true);
|
||||
if ($json['status']) {
|
||||
if($json['status']){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ class OrdersList
|
||||
{
|
||||
$this->ci = &get_instance();
|
||||
$this->ci->load->model('receiver/order/receiver_orders_model', 'mdOrders');
|
||||
$this->ci->load->model('receiver/order/receiver_order_datas_model', 'mdOrderData');
|
||||
$this->ci->load->model('receiver/order/receiver_order_datas_model');
|
||||
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
|
||||
$this->ci->load->model('app/licheb/app_licheb_channel_biz_model');
|
||||
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
|
||||
@@ -111,30 +109,6 @@ class OrdersList
|
||||
$where["bill_time <="] = $bill_time[1] . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
|
||||
//是否有合同
|
||||
if ($params['iscontract']) {
|
||||
$where_od['contract_img <>'] = '';
|
||||
$order_time[0] && $where_od['u_time >='] = $order_time[0] . ' 00:00:00';
|
||||
$rows_od = $this->ci->mdOrderData->select($where_od, '', 0, 0, 'o_id');
|
||||
$rows_od && $str_ids = implode(',', array_column($rows_od, 'o_id'));
|
||||
|
||||
if ($params['iscontract'] == 1) {
|
||||
$where["id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where["id not in({$str_ids})"] = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//是否开票
|
||||
if ($params['isbill'] == 1) {
|
||||
$where["bill_time <>"] = '0000-00-00 00:00:00';
|
||||
}
|
||||
if ($params['isbill'] == 2) {
|
||||
$where["bill_time"] = '0000-00-00 00:00:00';
|
||||
}
|
||||
|
||||
//交付时间
|
||||
if ($params['ck_time']) {
|
||||
$ck_time = explode(' ~ ', $params['ck_time']);
|
||||
@@ -151,10 +125,6 @@ class OrdersList
|
||||
$params['brand_id'] && $where['brand_id'] = $params['brand_id'];
|
||||
$params['series_id'] && $where['series_id'] = $params['series_id'];
|
||||
$params['car_id'] && $where['car_id'] = $params['car_id'];
|
||||
!strlen($params['cps_type']) && $params['cps_type'] = '';
|
||||
if (strlen($params['cps_type'])) {
|
||||
$where['cps_type'] = intval($params['cps_type']);
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where["sale_id"] = $params['admin_id'];
|
||||
@@ -192,19 +162,15 @@ class OrdersList
|
||||
if (strlen($params['status'])) {
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
if ($params['admin_biz_str']) {
|
||||
$where["biz_id in ({$params['admin_biz_str']})"] = null;
|
||||
}
|
||||
$orderby = "c_time desc";
|
||||
$count = $this->ci->mdOrders->count($where);
|
||||
$rows = $this->ci->mdOrders->select($where, $orderby, $page, $size);
|
||||
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
//客户来源
|
||||
$str_rids = implode(',', array_unique(array_column($rows, 'customer_id')));
|
||||
!$str_rids && $str_rids = 0;
|
||||
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id,p_time', array("id in({$str_rids})" => null));
|
||||
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
|
||||
$offlineSources = $this->ci->mdCustomers->offlineSources();
|
||||
//门店
|
||||
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
|
||||
@@ -245,7 +211,6 @@ class OrdersList
|
||||
$car_name = isset($cars[$val['car_id']]) ? $cars[$val['car_id']][0]['name'] : '';
|
||||
$money_json = json_decode($val['money_json'], true);
|
||||
$fields['o_id'] = $val['id'];
|
||||
$fields['sid'] = $val['sid'];
|
||||
$name = $val['name'];
|
||||
$mobile = $val['mobile'];
|
||||
$open_url = '/receiver/orders/get?id=';
|
||||
@@ -265,7 +230,6 @@ class OrdersList
|
||||
$fields['status_name'] = $status_name;
|
||||
$fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'] . '<br>' . $admins[$val['admin_id']] : '';
|
||||
$size > 1000 && $fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'] : '';
|
||||
$fields['p_time'] = date('Y-m-d H:i:s', strtotime($customers[$val['customer_id']]['p_time']));
|
||||
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
|
||||
$of_title = '-';
|
||||
$of_title_1 = $of_title_2 = '';
|
||||
@@ -278,7 +242,6 @@ class OrdersList
|
||||
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
|
||||
$of2_id && $of_ary['list'][$of2_id] && $of_title_2 = $of_ary['list'][$of2_id];
|
||||
}
|
||||
|
||||
$fields['of_title'] = $of_title;
|
||||
$fields['of_title_1'] = $of_title_1;
|
||||
$fields['of_title_2'] = $of_title_2;
|
||||
@@ -288,39 +251,12 @@ class OrdersList
|
||||
$fields['refund_time'] = $val['refund_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($val['refund_time'])) : '';
|
||||
$fields['ck_time'] = $val['ck_time'];
|
||||
|
||||
$odata = $this->ci->receiver_order_datas_model->get(['o_id' => $val['id']]);
|
||||
$fields['contract'] = $odata['contract_img'] ? '有' : '无';
|
||||
|
||||
if($odata['jsondata']){
|
||||
$bill_data = json_decode($odata['jsondata'], true);
|
||||
if(is_array($bill_data['bill_info'])){
|
||||
foreach ($bill_data['bill_info'] as $k => $v){
|
||||
if($v['Name'] == '销货单位名称'){
|
||||
$fields['bill_name'] = $v['Value'];
|
||||
}
|
||||
if($v['Name'] == '价税合计(小写)'){
|
||||
$fields['bill_price'] = $v['Value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($size > 1000) {
|
||||
$user_info = '';
|
||||
if (!$user_info) {
|
||||
$sale = $this->ci->mdLichebUsers->get(['id' => $val['sale_id']], 'uname');
|
||||
$fields['admin_name'] = $sale['uname'];
|
||||
}
|
||||
$fields['cps_type_name'] = Receiver_orders_model::CPS_TYPES[$val['cps_type']];
|
||||
} else {
|
||||
if ($val['cps_type'] == Receiver_orders_model::CPS_TYPE_NORMAl) {
|
||||
$cps_class = 'btn-success';
|
||||
} elseif ($val['cps_type'] == Receiver_orders_model::CPS_TYPE_IMPORTANT) {
|
||||
$cps_class = 'btn-danger';
|
||||
} else {
|
||||
$cps_class = 'btn-warning';
|
||||
}
|
||||
$fields['car_name'] .= "<br><span class='btn btn-xs {$cps_class}'>" . Receiver_orders_model::CPS_TYPES[$val['cps_type']] . "</span>";
|
||||
}
|
||||
$lists[] = $fields;
|
||||
}
|
||||
@@ -344,7 +280,6 @@ class OrdersList
|
||||
{
|
||||
$fields1 = $fields2 = [];
|
||||
if ($export) {
|
||||
$fields1['sid'] = ['title' => '订单号'];
|
||||
$fields1['name'] = ['title' => '客户姓名'];
|
||||
$fields1['mobile'] = ['title' => '客户电话'];
|
||||
$fields1['id_card'] = ['title' => '证件号码'];
|
||||
@@ -369,14 +304,9 @@ class OrdersList
|
||||
$fields = array_merge($fields1, $fields2);
|
||||
if ($export) {
|
||||
unset($fields['price'], $fields['c_time'], $fields['car_name'], $fields['of_title']);
|
||||
!$fields['p_time'] && $fields['p_time'] = ['title' => '建档时间'];
|
||||
!$fields['c_time'] && $fields['c_time'] = ['title' => '订单时间'];
|
||||
!$fields['order_time'] && $fields['order_time'] = ['title' => '下定时间'];
|
||||
!$fields['bill_time'] && $fields['bill_time'] = ['title' => '开票时间'];
|
||||
!$fields['contract'] && $fields['contract'] = ['title' => '购车合同'];
|
||||
$fields['cps_type_name'] = ['title' => 'CPS品牌'];
|
||||
$fields['bill_name'] = ['title' => '开票方'];
|
||||
$fields['bill_price'] = ['title' => '开票价'];
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<label><input type="checkbox" data-check-target=".ids"></label>
|
||||
<span>ID</span>
|
||||
</th>
|
||||
<th width="10%"><span>车型id</span></th>
|
||||
<th width="10%"><span>品牌</span></th>
|
||||
<th width="10%"><span>车系</span></th>
|
||||
<th width="20%"><span>车型</span></th>
|
||||
@@ -56,6 +57,7 @@
|
||||
<label><input type="checkbox" name="ids[]" class="ids" :value="v.id"/></label>
|
||||
<span>{{v.id}}</span>
|
||||
</td>
|
||||
<td>{{v.third_car_id}}</td>
|
||||
<td>{{v.brand}}</td>
|
||||
<td>{{v.series}}</td>
|
||||
<td>{{v.name}}</td>
|
||||
|
||||
@@ -1,492 +0,0 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
</div>
|
||||
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/autohome/customer" id="search_form">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w200">
|
||||
<input name="mobile" type="text" placeholder="输入手机号查询" value="<?= $params['mobile'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">上传状态:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="push_id">
|
||||
<option value=''>请选择</option>
|
||||
<option value='0' <?php if($params['push_id'] == '0'){?> selected="selected" <?php }?> >未上传</option>
|
||||
<option value='1' <?php if($params['push_id'] == '1'){?> selected="selected" <?php }?> >上传成功</option>
|
||||
<option value='-1' <?php if($params['push_id'] == '-1'){?> selected="selected" <?php }?> >上传失败</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">分发状态:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="dis_status">
|
||||
<option value=''>请选择</option>
|
||||
<option value='0' <?php if($params['dis_status'] == '0'){?> selected="selected" <?php }?> >未分发</option>
|
||||
<option value='1' <?php if($params['dis_status'] == '1'){?> selected="selected" <?php }?> >分发成功</option>
|
||||
<option value='2' <?php if($params['dis_status'] == '2'){?> selected="selected" <?php }?> >分发失败</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl" style="width:1920px">
|
||||
<label class="am-para-label w100">线索来源:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="cfrom_id" v-model="cfrom_id">
|
||||
<option value=0>请选择</option>
|
||||
<option :value="i" v-for="(v,i) in cfromAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="cfrom_id2" v-model="cfrom_id2">
|
||||
<option value=0>请选择</option>
|
||||
<option :value="i" v-for="(v,i) in cfromAry2">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="am-para-label w100">线索渠道:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="channel" v-model="channel">
|
||||
<option value=0>请选择</option>
|
||||
<option :value="i" v-for="(v,i) in channelAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<label class="am-para-label w100">所属地区:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="province_id" v-model="province_id">
|
||||
<option value="0">省份</option>
|
||||
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="city_id" v-model="city_id">
|
||||
<option value="0">城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="am-para-label w100">品牌车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="brand_id">
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="series_id" v-model="series_id">
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl" style="width:1920px">
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
placeholder="创建时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="create"
|
||||
data-source="id-create-time">今日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="create"
|
||||
data-source="id-create-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="create"
|
||||
data-source="id-create-time">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="create"
|
||||
data-source="id-create-time">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl" style="width:1920px">
|
||||
<label class="am-para-label w100">上传时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-push-time" name="p_time" type="text" value="<?= $params['p_time'] ?>"
|
||||
placeholder="上传时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="push"
|
||||
data-source="id-push-time">今日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="push"
|
||||
data-source="id-push-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="push"
|
||||
data-source="id-push-time">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="push"
|
||||
data-source="id-push-time">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div-- class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml30">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
|
||||
</div>
|
||||
<!--div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out"
|
||||
title="最多500条" v-if="export_button">导出
|
||||
</button>
|
||||
</div-->
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w150" @click="push_search">按搜索结果上传</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="15%"><span>客户</span></th>
|
||||
<th width="15%"><span>所属地区</span></th>
|
||||
<th width="15%"><span>品牌车型</span></th>
|
||||
<th width="15%"><span>线索来源</span></th>
|
||||
<th width="15%"><span>线索渠道</span></th>
|
||||
<th width="10%"><span>上传状态</span></th>
|
||||
<th width="10%"><span>分发状态</span></th>
|
||||
<th width="15%"><span>上传时间</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td style="vertical-align: middle;"><a
|
||||
data-open="/receiver/clues/get?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);"><?= $v['name'] ?><br><?= $v['mobile'] ?></a></td>
|
||||
<td style="vertical-align: middle;"><?= $v['area_title'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['car_title'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['cf_title'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['channel'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['push_status'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['dis_status'] ?></td>
|
||||
<td style="vertical-align: middle;"><?=$v['c_time']?></td>
|
||||
</tr>
|
||||
<? }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<? page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="cule-modal" style="display: none;padding: 10px">
|
||||
<div class="modal-body">
|
||||
<div class="text-center">
|
||||
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
|
||||
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
|
||||
<div class="form-group-action">
|
||||
<a href="/temp/clues.xlsx" target="_blank" class="btn btn-default">查看模板</a>
|
||||
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
|
||||
<form id="import-form">
|
||||
<input type="file" id="clue-file" name="file" accept=".xls,.xlsx"
|
||||
style="left:-9999px;position:absolute;" onchange="load_clue()">
|
||||
</form>
|
||||
<span>上传Excel文件</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#search_form',
|
||||
data: {
|
||||
province_id: <?=$params['province_id'] ? $params['province_id'] : 0?>,
|
||||
city_id: <?=$params['city_id'] ? $params['city_id'] : 0?>,
|
||||
cfrom_id: <?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
|
||||
cfrom_id2: <?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
|
||||
brand_id: <?=$params['brand_id'] ? $params['brand_id'] : 0?>,
|
||||
series_id: <?=$params['series_id'] ? $params['series_id'] : 0?>,
|
||||
channel: <?=$params['channel'] ? $params['channel'] : 0?>,
|
||||
cfromAry: [],
|
||||
cfromAry2: [],
|
||||
channelAry: [],
|
||||
provinceAry: [],
|
||||
cityAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
export_button: 1
|
||||
},
|
||||
mounted: function () {
|
||||
this.init_provinces();
|
||||
this.init_citys();
|
||||
this.cfromAry = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
|
||||
this.channelAry = <?=json_encode($channelAry, JSON_UNESCAPED_UNICODE)?>;
|
||||
this.init_brands();
|
||||
this.get_series();
|
||||
this.init_cfrom2();
|
||||
},
|
||||
methods: {
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
|
||||
vm.brandAry = response.data;
|
||||
})
|
||||
},
|
||||
get_series: function () {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.brand_id}, function (response) {
|
||||
vm.seryAry = response.data;
|
||||
})
|
||||
},
|
||||
init_provinces: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.provinceAry = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {id: vm.province_id, key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
init_cfrom2: function () {
|
||||
var vm = this;
|
||||
$.get('autohome/customer/json_map_cfrom', {pid: vm.cfrom_id}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cfromAry2 = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$('#search_tp').val('mobile');
|
||||
$('#title').val('');
|
||||
$('#id-create-time').val('');
|
||||
$('#id-push-time').val('');
|
||||
that.province_id = 0;
|
||||
that.city_id = 0;
|
||||
that.cfrom_id = 0;
|
||||
that.cfrom2_id = 0;
|
||||
that.brand_id = 0;
|
||||
that.series_id = 0;
|
||||
that.channel = 0;
|
||||
},
|
||||
export_out: function () {
|
||||
var that = this;
|
||||
if (that.export_button == 0) {
|
||||
layer.msg('无权限导出');
|
||||
return false;
|
||||
}
|
||||
let count = <?=$pager['totle']?>;
|
||||
if (count == 0) {
|
||||
layer.msg('没有数据可导出');
|
||||
return false;
|
||||
}
|
||||
let href = $.menu.parseUri(window.location.href);
|
||||
href = href.replace("clues?", "clues/export?");
|
||||
window.location.href = href;
|
||||
},
|
||||
push_search: function (){
|
||||
let queryString = window.location.hash.split("?")[1];
|
||||
params = queryString.substring(1).split('&');
|
||||
paramsObj = {};
|
||||
params.forEach(param => {
|
||||
[key, value] = param.split('=');
|
||||
paramsObj[key] = decodeURIComponent(value);
|
||||
});
|
||||
|
||||
$.get('autohome/customer/push_search', paramsObj, function (response) {
|
||||
if (response.code == 1) {
|
||||
layer.msg('上传成功:'+ response.data.succ+' '+'上传失败:' + response.data.fail+' '+'未处理:' + response.data.undo);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'brand_id': function (nv, ov) {
|
||||
if (nv !== '') {
|
||||
this.get_series()
|
||||
}
|
||||
},
|
||||
'province_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.cityAry = [];
|
||||
that.city_id = '0';
|
||||
} else {
|
||||
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
that.cityAry = response.data;
|
||||
if (that.city_id > 0) {
|
||||
var city_id = '0';
|
||||
for (var i in that.cityAry) {
|
||||
var city = that.cityAry[i];
|
||||
if (city.id == that.city_id) {
|
||||
city_id = city.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.city_id = city_id;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.countyAry = [];
|
||||
that.county_id = '0';
|
||||
} else {
|
||||
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
that.countyAry = response.data;
|
||||
if (that.county_id > 0) {
|
||||
var county_id = '0';
|
||||
for (var i in that.countyAry) {
|
||||
var county = that.countyAry[i];
|
||||
if (county.id == that.county_id) {
|
||||
county_id = county.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.county_id = county_id;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'cfrom_id': function (nv, ov) {
|
||||
var that = this;
|
||||
that.cfrom_id2 = 0;
|
||||
if (nv == '') {
|
||||
that.cfromAry2 = [];
|
||||
} else {
|
||||
$.post('/autohome/customer/json_map_cfrom', {pid: nv}, function (result) {
|
||||
that.cfromAry2 = result.data;
|
||||
if (that.cfrom_id2 > 0) {
|
||||
var of2_id = '';
|
||||
for (var i in that.show_info.cfromAry2) {
|
||||
if (i == that.cfrom_id2) {
|
||||
of2_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.cfrom_id2 = of2_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#import").click(function () {
|
||||
$("#clue-file").val('');
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['40%'], //宽高
|
||||
content: $('#cule-modal'),
|
||||
title: '导入线索',
|
||||
shade: false,
|
||||
btn: ['完成'],
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-create-time', range: '~'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#id-push-time', range: '~'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), date = '', nowDate = new Date();
|
||||
var source_id = $(this).data('source') || 'id-create-time';
|
||||
var beginDate = '', endDate = '';
|
||||
switch (type) {
|
||||
case 'today':
|
||||
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'yesterday':
|
||||
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'weeks':
|
||||
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
nowDate.setDate(nowDate.getDate() + 6);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
break;
|
||||
case 'month':
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
|
||||
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
|
||||
break;
|
||||
}
|
||||
date = beginDate + ' ~ ' + endDate;
|
||||
//$('#' + source_id).val(date);
|
||||
switch ($(this).data('btn')) {
|
||||
case 'create':
|
||||
$('#id-create-time').val(date);
|
||||
break;
|
||||
case 'push':
|
||||
$('#id-push-time').val(date);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function load_clue() {
|
||||
var file = $("#clue-file");
|
||||
if (file.val() == '') {
|
||||
layer.msg('文件是空的');
|
||||
return 0;
|
||||
}
|
||||
var loading = layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
|
||||
var options = {
|
||||
url: "/autohome/customer/add_excel",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (res) {
|
||||
if (1 == res.code) {
|
||||
layer.msg(res.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
file.val('');
|
||||
layer.close(loading);
|
||||
}
|
||||
};
|
||||
$("#import-form").ajaxSubmit(options);
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -206,8 +206,7 @@
|
||||
<div class="am-form-group">
|
||||
<div class="am-para-input">
|
||||
<div class="am-input-group am-input-group-primary">
|
||||
<input type="text" placeholder="详细地址" id="address" name="address"
|
||||
value="<?= $biz['address'] ?>"/>
|
||||
<input type="text" placeholder="详细地址" id="address" name="address" value="<?= $biz['address'] ?>"/>
|
||||
<span class="am-input-group-btn">
|
||||
<button id="addr-btn" class="am-btn am-btn-primary" type="button"><span
|
||||
class="am-icon-search"></span></button>
|
||||
@@ -220,14 +219,12 @@
|
||||
<div class="am-form-inline">
|
||||
<div class="am-input-group">
|
||||
<span class="am-input-group-label">经度</span>
|
||||
<input type="text" class="am-form-field" placeholder="经度" name="lng"
|
||||
value="<?= $biz['lng'] ?>"
|
||||
<input type="text" class="am-form-field" placeholder="经度" name="lng" value="<?= $biz['lng'] ?>"
|
||||
id="biz-edit-lng">
|
||||
</div>
|
||||
<div class="am-input-group">
|
||||
<span class="am-input-group-label">纬度</span>
|
||||
<input type="text" class="am-form-field" placeholder="纬度" name="lat"
|
||||
value="<?= $biz['lat'] ?>"
|
||||
<input type="text" class="am-form-field" placeholder="纬度" name="lat" value="<?= $biz['lat'] ?>"
|
||||
id="biz-edit-lat">
|
||||
</div>
|
||||
</div>
|
||||
@@ -257,15 +254,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">类型:</label>
|
||||
<div class="am-para-input wp20">
|
||||
<select name="type" v-model="info.type">
|
||||
<option value="0">选择类型</option>
|
||||
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-success" type="submit">提交</button>
|
||||
@@ -364,15 +352,16 @@
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
cate_id: <?=$biz['cate_id'] ? $biz['cate_id'] : "''"?>,
|
||||
info: <?=json_encode($biz)?>,
|
||||
typeAry: <?=json_encode($typeAry)?>,
|
||||
info:<?=json_encode($biz)?>,
|
||||
},
|
||||
mounted: function () {
|
||||
},
|
||||
methods: {},
|
||||
methods: {
|
||||
},
|
||||
created: function () {
|
||||
},
|
||||
watch: {}
|
||||
watch: {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,16 +39,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">门店类型:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="type" v-model="type">
|
||||
<option value="0">所有</option>
|
||||
<option :value="i" v-for="(v,i) in typeAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
@@ -82,7 +73,6 @@
|
||||
<th width="50"></th>
|
||||
<th width="5%"><span>ID</span></th>
|
||||
<th><span>门店</span></th>
|
||||
<th width="10%"><span>门店类型</span></th>
|
||||
<th width="15%"><span>创建时间</span></th>
|
||||
<th width="20%"><span>操作</span></th>
|
||||
</tr>
|
||||
@@ -95,7 +85,6 @@
|
||||
</td>
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['biz_name'] ?></td>
|
||||
<td><?= $v['biz_type'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td>
|
||||
<a data-open="/biz/store/store/get?id=<?= $v['id'] ?>" class="am-btn am-btn-primary am-btn-xs">修改</a>
|
||||
@@ -190,17 +179,16 @@
|
||||
var vm = new Vue({
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
province_id: <?=$params['province_id'] ? $params['province_id'] : 0?>,
|
||||
city_id: <?=$params['city_id'] ? $params['city_id'] : 0?>,
|
||||
county_id: <?=$params['county_id'] ? $params['county_id'] : 0?>,
|
||||
type: <?=$params['type'] ? $params['type'] : 0?>,
|
||||
province_id:<?=$params['province_id'] ? $params['province_id'] : 0?>,
|
||||
city_id:<?=$params['city_id'] ? $params['city_id'] : 0?>,
|
||||
county_id:<?=$params['county_id'] ? $params['county_id'] : 0?>,
|
||||
qdjl_lists: [],
|
||||
channel_uid: [],
|
||||
biz_manage: {admins: [], group_id: 2, admin_id: 0, biz_id: 0, admin_name: ''},
|
||||
typeAry: <?=$typeAry ? json_encode($typeAry) : '[]'?>,
|
||||
typeAry:<?=$typeAry ? json_encode($typeAry) : '[]'?>,
|
||||
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
countyAry: []
|
||||
},
|
||||
mounted: function () {
|
||||
this.qdjl_lists = <?=json_encode($qdjl_lists)?>;
|
||||
@@ -208,7 +196,7 @@
|
||||
this.init_countys();
|
||||
},
|
||||
methods: {
|
||||
channel_modal: function (biz_id, biz_name) {
|
||||
channel_modal: function (biz_id,biz_name) {
|
||||
//选择渠道归属
|
||||
var vm = this;
|
||||
vm.channels = [];
|
||||
@@ -227,7 +215,7 @@
|
||||
type: 1,
|
||||
area: ['50%', '40%'], //宽高
|
||||
content: $('#channel-modal'),
|
||||
title: biz_name + '-渠道归属',
|
||||
title: biz_name+'-渠道归属',
|
||||
shade: false,
|
||||
btn: ['保存选择'],
|
||||
yes: function (index) {
|
||||
@@ -248,7 +236,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
biz_manage_modal: function (biz_id, biz_name) {
|
||||
biz_manage_modal: function (biz_id,biz_name) {
|
||||
//选择门店管理员
|
||||
var vm = this;
|
||||
vm.biz_manage = {admins: [], group_id: 2, admin_id: 0, biz_id: biz_id, admin_name: ''};
|
||||
@@ -257,7 +245,7 @@
|
||||
type: 1,
|
||||
area: ['50%', '50%'], //宽高
|
||||
content: $('#biz_manage-modal'),
|
||||
title: biz_name + '-门店管理员',
|
||||
title: biz_name+'-门店管理员',
|
||||
shade: false,
|
||||
btn: ['保存选择'],
|
||||
yes: function (index) {
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/switch.css">
|
||||
<link rel="stylesheet" type="text/css" href="/static/js/plugin/viewer/viewer.css?t=3">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
|
||||
|
||||
<script type="text/javascript" src="/static/js/plugin/bootstrap-select/popper.min.js"></script>
|
||||
<script type="text/javascript" src="/static/js/common/jquery-3.0.0.js"></script>
|
||||
<script type="text/javascript" src="/static/js/common/vue.min.js"></script>
|
||||
<script type="text/javascript" src="/AmazeUI/assets/js/amazeui.js"></script>
|
||||
@@ -37,8 +34,6 @@
|
||||
<script type="text/javascript" src="/static/js/common/vuedraggable.umd.min.js?t=2020221"></script>
|
||||
<script type="text/javascript" src="/static/js/common/jquery.form.js?t=2020410"></script>
|
||||
<script type="text/javascript" src="/static/js/plugin/viewer/viewer.js?t=4"></script>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script>window.ROOT_URL = '';</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -159,7 +154,7 @@
|
||||
</body>
|
||||
|
||||
<script type="text/javascript" src="/static/js/plugin/require/require.js"></script>
|
||||
<script type="text/javascript" src="/static/js/common/app.js?v=1"></script>
|
||||
<script type="text/javascript" src="/static/js/common/app.js"></script>
|
||||
<script type="text/javascript">
|
||||
//查看图片控件
|
||||
function showViewer(obj){
|
||||
|
||||
@@ -113,17 +113,12 @@
|
||||
}
|
||||
|
||||
function getCode(obj) {
|
||||
|
||||
settime($(obj));
|
||||
let mobile = "<?=$mobile?>";
|
||||
let need_code = $('[name="need_code"]').val();
|
||||
if (need_code == 'logsms'){
|
||||
mobile = $('[name="number"]').val();
|
||||
}
|
||||
if(!mobile){
|
||||
layer.msg("请输入手机号")
|
||||
return false
|
||||
}
|
||||
settime($(obj));
|
||||
$('[name="need_code"]').val('get');
|
||||
$.ajax({
|
||||
'url': 'get_code',
|
||||
@@ -136,9 +131,6 @@
|
||||
if (need_code == 'logsms'){
|
||||
$('[name="need_code"]').val(need_code);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
<style>
|
||||
.el-input__inner {
|
||||
background-color: white!important;
|
||||
}
|
||||
.el-input__inner {
|
||||
height: 36.8px; /* 设置输入框高度 */
|
||||
</style>
|
||||
</style>
|
||||
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
|
||||
<div id="vue-edit">
|
||||
<div class="am-g">
|
||||
@@ -75,7 +67,8 @@
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">手机号码:</div>
|
||||
<input style="width: 150px;" type="text" v-model="info.mobile" placeholder="请输入手机号">
|
||||
{{infoShow.mobile_sub}}
|
||||
<a href="javascript:void(0);" data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues" class="am-btn am-btn-sm am-btn-success ml20" data-title="获取手机号">拨打</a>
|
||||
<!--a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=clues" data-title="发送短信" class="am-btn am-btn-sm am-btn-success ml10">短信</a-->
|
||||
</div>
|
||||
</td>
|
||||
@@ -91,29 +84,6 @@
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<td class="table-td">
|
||||
<div class="input-group-addon">关注车型:</div>
|
||||
<div class="input-group-addon">
|
||||
<el-select v-model="info.brand_id" filterable placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in brandAry"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--
|
||||
<select name="info.brand_id" v-model="info.brand_id">
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
-->
|
||||
</div>
|
||||
<div class="input-group-addon" style="width:160px;">
|
||||
<select name="info.series_id" v-model="info.series_id" class="ml5">
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
@@ -145,7 +115,7 @@
|
||||
<option :value="i" v-for="(v,i) in cfroms">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group-addon" style="width:160px;">
|
||||
<div class="input-group-addon">
|
||||
<select name="info.cf2_id" v-model="info.cf2_id" class="ml5">
|
||||
<option value="0">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in cfroms2">{{v}}</option>
|
||||
@@ -167,30 +137,10 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">平安推荐:</div>
|
||||
<el-select v-model="info.cf_pid" filterable placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in paicUser"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</td>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
<div class="input-group" style="margin-left: 30px;">
|
||||
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(2)" >保存</a>
|
||||
<a href="javascript:void(0);" data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues" class="am-btn am-btn-sm am-btn-danger ml20" data-title="获取手机号">拨打</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -327,10 +277,7 @@
|
||||
countyAry: [],
|
||||
cfroms: [],
|
||||
cfroms2: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
admins: {provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>, cityAry: [], countyAry: [], bizAry: []},
|
||||
paicUser: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var that = this;
|
||||
@@ -339,9 +286,6 @@
|
||||
that.cfroms = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
|
||||
that.cfroms2 = <?=json_encode($cfromAry2, JSON_UNESCAPED_UNICODE)?>;
|
||||
that.init_provinces();
|
||||
that.init_brands();
|
||||
that.get_series();
|
||||
this.loadPaicUser();
|
||||
},
|
||||
computed: {},
|
||||
created: function () {
|
||||
@@ -349,29 +293,6 @@
|
||||
updated: function () {
|
||||
},
|
||||
methods: {
|
||||
loadPaicUser() {
|
||||
let that = this
|
||||
$.get('/common/get_paic_users', {}, function (response) {
|
||||
that.paicUser = response.data
|
||||
})
|
||||
},
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
|
||||
vm.brandAry = response.data;
|
||||
})
|
||||
},
|
||||
get_series: function () {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.info.brand_id}, function (response) {
|
||||
vm.seryAry = response.data;
|
||||
// if (if_reset) {
|
||||
// vm.params.series_id = 0;
|
||||
// vm.params.car_id = 0;
|
||||
// }
|
||||
})
|
||||
},
|
||||
init_provinces: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {}, function (response) {
|
||||
@@ -521,11 +442,6 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'info.brand_id': function (nv, ov) {
|
||||
if (nv !== '') {
|
||||
this.get_series()
|
||||
}
|
||||
},
|
||||
'info.province_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
|
||||
@@ -1,22 +1,11 @@
|
||||
<style>
|
||||
.el-input__inner {
|
||||
background-color: white!important;
|
||||
}
|
||||
</style>
|
||||
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post"
|
||||
style="padding-top: 10px;padding-bottom: 10px;"
|
||||
action="" id="edit-form">
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">姓名:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<div class="am-para-input w150">
|
||||
<input type="text" placeholder="输入姓名" v-model="info.name" name="name"/>
|
||||
</div>
|
||||
<div class="am-para-inline w100">
|
||||
<input type="radio" v-model="info.sex" name="sex" value="先生"> <label
|
||||
style="text-align: center;font-size: 1.6rem;line-height: 37px;">先生</label>
|
||||
<input type="radio" v-model="info.sex" name="sex" value="女士"><label
|
||||
style="text-align: center;font-size: 1.6rem;line-height: 37px;">女士</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">手机号:</label>
|
||||
@@ -24,32 +13,6 @@
|
||||
<input type="text" placeholder="输入手机号" v-model="info.mobile" name="mobile" maxlength="11"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl" style="width:1920px">
|
||||
<label class="am-para-label w110">派单门店:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="省份" name="province_id_admin" v-model="province_id_admin">
|
||||
<option :value="v.province_id" v-for="(v,i) in admins.provinceAry">{{v.province_name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="城市" name="city_id_admin" v-model="city_id_admin">
|
||||
<option value="0">城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="行政区" name="county_id_admin" v-model="county_id_admin">
|
||||
<option value="0">行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w180">
|
||||
<select name="biz_id_admin" v-model="biz_id_admin">
|
||||
<option value="0">门店</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.bizAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">所在地区:</label>
|
||||
<div class="am-form-group am-para-inline w100">
|
||||
@@ -72,6 +35,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl" style="width:1920px">
|
||||
<label class="am-para-label w110">派单门店:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="省份" name="province_id_admin" v-model="province_id_admin">
|
||||
<option value="0">省份</option>
|
||||
<option :value="v.province_id" v-for="(v,i) in admins.provinceAry">{{v.province_name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="城市" name="city_id_admin" v-model="city_id_admin">
|
||||
<option value="0">城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="行政区" name="county_id_admin" v-model="county_id_admin">
|
||||
<option value="0">行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w180">
|
||||
<select name="biz_id_admin" v-model="biz_id_admin">
|
||||
<option value="0">门店</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.bizAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">来源:</label>
|
||||
<div class="am-para-input w300">
|
||||
@@ -85,55 +76,9 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">关注车型:</label>
|
||||
<div class="am-para-inline w160">
|
||||
<el-select v-model="info.brand_id" filterable placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in brandAry"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--
|
||||
<input type="text" v-model="inputValue" @input="handleInput" placeholder="输入品牌">
|
||||
<ul class="am-dropdown-content" :style="'display:'+[showSelect?'block':'none']">
|
||||
<li v-for="item in inputSelect">
|
||||
<a href="javascript:;" @click="selectInput(item)">{{item.name}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
-->
|
||||
</div>
|
||||
<div class="am-para-inline w160">
|
||||
<select name="series_id" v-model="info.series_id">
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">平安推荐:</label>
|
||||
<div class="am-para-inline">
|
||||
<el-select v-model="info.cf_pid" filterable placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in paicUser"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">填写小记:</label>
|
||||
<div class="am-para-inline">
|
||||
<textarea v-model="info.text" style="width: 600px; height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-secondary" type="button" id="add-btn" @click="saveEdit">保存</button>
|
||||
<button class="am-btn am-btn-danger" type="button" id="push-btn" @click="savePush">保存并转交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -145,34 +90,22 @@
|
||||
el: '#edit-form',
|
||||
data: {
|
||||
info: {},
|
||||
province_id: 350000,
|
||||
city_id: 0,
|
||||
county_id: 0,
|
||||
province_id_admin: 350000,
|
||||
city_id_admin: 0,
|
||||
county_id_admin: 0,
|
||||
biz_id_admin: 0,
|
||||
province_idn:0,
|
||||
city_id:0,
|
||||
county_id:0,
|
||||
province_id_admin:0,
|
||||
city_id_admin:0,
|
||||
county_id_admin:0,
|
||||
biz_id_admin:0,
|
||||
cfromAry: [],
|
||||
cfromAry2: [],
|
||||
provinceAry: [],
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
admins: {
|
||||
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
bizAry: []
|
||||
},
|
||||
admins: {provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>, cityAry: [], countyAry: [], bizAry: []},
|
||||
action: "",
|
||||
inputValue: "",
|
||||
showSelect: false,
|
||||
inputSelect: [],
|
||||
paicUser: []
|
||||
},
|
||||
mounted: function () {
|
||||
this.get_brand();
|
||||
this.init_provinces();
|
||||
this.init_citys();
|
||||
this.init_countys();
|
||||
@@ -180,52 +113,8 @@
|
||||
this.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
|
||||
this.cfromAry = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
|
||||
this.action = "<?=$action?>";
|
||||
this.loadPaicUser();
|
||||
// this.init_brands();
|
||||
// this.get_series();
|
||||
},
|
||||
methods: {
|
||||
loadPaicUser() {
|
||||
let that = this
|
||||
$.get('/common/get_paic_users', {}, function (response) {
|
||||
that.paicUser = response.data
|
||||
})
|
||||
},
|
||||
// selectInput: function (item) {
|
||||
// console.log(item)
|
||||
// this.inputValue = item.name
|
||||
// this.info.brand_id = item.id
|
||||
// this.showSelect = false
|
||||
// },
|
||||
// handleInput: function (event) {
|
||||
// console.log('输入值:', this.inputValue);
|
||||
// // 请求接口
|
||||
// var that = this;
|
||||
// $.get('/common/auto_search', {'name': this.inputValue}, function (response) {
|
||||
// that.inputSelect = response.data;
|
||||
// setTimeout(function () {
|
||||
// if (that.inputSelect && that.inputSelect.length > 0) {
|
||||
// that.showSelect = true
|
||||
// } else {
|
||||
// that.showSelect = false
|
||||
// }
|
||||
// }, 100)
|
||||
// })
|
||||
// },
|
||||
get_brand: function () {
|
||||
var vm = this;
|
||||
vm.brandAry = {};
|
||||
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
|
||||
vm.brandAry = response.data;
|
||||
})
|
||||
},
|
||||
get_series: function () {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.info.brand_id}, function (response) {
|
||||
vm.seryAry = response.data;
|
||||
})
|
||||
},
|
||||
init_provinces: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {}, function (response) {
|
||||
@@ -241,7 +130,7 @@
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
$.get('common/area', {id: 350000, key: 'city', type: 1}, function (response) {
|
||||
$.get('common/area', {id: vm.province_id_admin, key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.admins.cityAry = response.data;
|
||||
}
|
||||
@@ -287,45 +176,6 @@
|
||||
loading = 1;
|
||||
vm.info.biz_id = vm.biz_id_admin;
|
||||
|
||||
$.ajax({
|
||||
url: "receiver/clues/" + vm.action,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
info: vm.info
|
||||
},
|
||||
beforeSend: function () {
|
||||
layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data['code']) {
|
||||
layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
$.form.href('/receiver/clues');
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
loading = false;
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
},
|
||||
savePush: function () {
|
||||
var vm = this;
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
loading = 1;
|
||||
vm.info.biz_id = vm.biz_id_admin;
|
||||
vm.info.push = 1;
|
||||
|
||||
$.ajax({
|
||||
url: "receiver/clues/" + vm.action,
|
||||
type: 'post',
|
||||
@@ -358,11 +208,6 @@
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'info.brand_id': function (nv, ov) {
|
||||
if (nv !== '') {
|
||||
this.get_series()
|
||||
}
|
||||
},
|
||||
'info.province_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post"
|
||||
style="padding-top: 10px;padding-bottom: 10px;"
|
||||
action="/receiver/clues/edit_admins" id="edit-form">
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">跟进人员:</label>
|
||||
<div class="am-para-input w300">
|
||||
<select name="biz_id" v-model="admin_id">
|
||||
<option value="">请选择用户</option>
|
||||
<template v-for="(v,i) in adminList">
|
||||
<option :value="v.id">{{v.username}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-para-input">
|
||||
<input type="hidden" name="ids" value="<?= $ids ?>">
|
||||
<button class="am-btn am-btn-secondary" type="button" @click="save()">保存分配</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#edit-form',
|
||||
data: {
|
||||
adminList: [],
|
||||
admin_id: ''
|
||||
},
|
||||
mounted: function () {
|
||||
this.adminList = <?=$adminLists ? json_encode($adminLists, JSON_UNESCAPED_UNICODE) : '{}'?>;
|
||||
},
|
||||
methods: {
|
||||
save: function () {
|
||||
if (!this.admin_id) {
|
||||
layer.msg('请选择跟进人员', {'icon': 2});
|
||||
return false
|
||||
}
|
||||
pdata = {'admin_id': this.admin_id, 'ids': '<?=$ids?>'}
|
||||
$.post('receiver/clues/edit_admins', pdata, function (response) {
|
||||
if (response.code == 1) {
|
||||
layer.msg(response.msg, {'icon': 1}, function () {
|
||||
layer.closeAll();
|
||||
$.form.reload();
|
||||
})
|
||||
} else {
|
||||
layer.msg(response.msg, {'icon': 2});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -1,13 +1,4 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<style>
|
||||
.el-input__inner {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 32.4px !important; /* 设置输入框高度 */
|
||||
}
|
||||
</style>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@@ -58,7 +49,6 @@
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/clues" id="search_form">
|
||||
<input name="status" value="<?= $params['status'] ?>" type="hidden">
|
||||
<input name="status2" value="<?= $params['status2'] ?>" type="hidden">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
@@ -138,49 +128,16 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">重点关注车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<input type="hidden" name="brand_id" v-model="brand_id">
|
||||
<el-select v-model="brand_id" filterable placeholder="请选择" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in brandAry"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--
|
||||
<select name="brand_id" v-model="brand_id">
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
-->
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="series_id" v-model="series_id">
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl" style="width:100%">
|
||||
<div class="am-form-group fl" style="width:1920px">
|
||||
<label class="am-para-label w100">添加微信:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="添加微信" name="wxgr">
|
||||
<option value="">全部</option>
|
||||
<option value="1" <?= $params['wxgr'] == '1' ? 'selected' : '' ?>>是</option>
|
||||
<option value="0" <?= $params['wxgr'] == '0' ? 'selected' : '' ?>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="am-para-label w100">跟进人员:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="admin_id" v-model="admin_id">
|
||||
<option value="">所有</option>
|
||||
<option value="0">无</option>
|
||||
<option :value="v.id" v-for="(v,i) in adminAry">{{v.username}}</option>
|
||||
</select>
|
||||
<select title="添加微信" name="wxgr">
|
||||
<option value="2">全部</option>
|
||||
<option value="1" <?= $params['wxgr'] == 1 ? 'selected' : '' ?>>是</option>
|
||||
<option value="0" <?= $params['wxgr'] == 0 ? 'selected' : '' ?>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fl" style="width:1920px">
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
@@ -189,36 +146,17 @@
|
||||
placeholder="创建时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="create"
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
|
||||
data-source="id-create-time">今日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="create"
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
|
||||
data-source="id-create-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="create"
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
|
||||
data-source="id-create-time">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="create"
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
|
||||
data-source="id-create-time">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl" style="width:1920px">
|
||||
<label class="am-para-label w100">分配时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-p-time" name="p_time" type="text" value="<?= $params['p_time'] ?>"
|
||||
placeholder="分配时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="p"
|
||||
data-source="id-p-time">今日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="p"
|
||||
data-source="id-p-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="p"
|
||||
data-source="id-p-time">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="p"
|
||||
data-source="id-p-time">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml30">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
@@ -233,19 +171,13 @@
|
||||
</button>
|
||||
</div-->
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
|
||||
onclick="edit_counselor();">分配
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
|
||||
data-open="/receiver/clues/get_add" data-title="新增线索">新增
|
||||
data-modal="/receiver/clues/get_add" data-title="新增线索">新增
|
||||
</button>
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out()"
|
||||
title="最多500条" v-if="export_button">导出
|
||||
@@ -266,11 +198,9 @@
|
||||
<th width="12%"><span>线索来源</span></th>
|
||||
<th width="12%"><span>所在地区</span></th>
|
||||
<th width="12%"><span>所派门店</span></th>
|
||||
<th width="8%"><span>状态</span></th>
|
||||
<th width="12%"><span>分配时间</span></th>
|
||||
<th width="5%"><span>状态</span></th>
|
||||
<th width="12%"><span>创建时间</span></th>
|
||||
<th width="12%"><span>更新时间</span></th>
|
||||
<th width="10%"><span>跟进人员</span></th>
|
||||
<th width="15%"><span>跟进人员</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -286,9 +216,7 @@
|
||||
<td style="vertical-align: middle;"><?= $v['poi'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['biz_poi'] ?><br><?= $v['biz_name'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['status_name'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['p_time'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['u_time'] ?></td>
|
||||
<td style="vertical-align: middle;"><?= $v['admin_name'] ?></td>
|
||||
</tr>
|
||||
<? }
|
||||
@@ -337,15 +265,11 @@
|
||||
biz_id_admin: <?=$params['biz_id_admin'] ? $params['biz_id_admin'] : 0?>,
|
||||
cfrom_id: <?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
|
||||
cfrom_id2: <?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
|
||||
brand_id: '<?=$params['brand_id'] ? $params['brand_id'] : ''?>',
|
||||
series_id: <?=$params['series_id'] ? $params['series_id'] : 0?>,
|
||||
cfroms: [],
|
||||
cfroms2: [],
|
||||
provinceAry: [],
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
admins: {
|
||||
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
|
||||
cityAry: [],
|
||||
@@ -353,8 +277,6 @@
|
||||
bizAry: []
|
||||
},
|
||||
export_button: <?=$export_button?>,
|
||||
admin_id: <?=strlen($params['admin_id']) ? $params['admin_id'] : '""'?>,
|
||||
adminAry: <?=$adminLists ? json_encode($adminLists) : '[]'?>,
|
||||
},
|
||||
mounted: function () {
|
||||
this.init_provinces();
|
||||
@@ -363,23 +285,8 @@
|
||||
this.init_bizs();
|
||||
this.cfroms = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
|
||||
this.cfroms2 = <?=json_encode($cfromAry2, JSON_UNESCAPED_UNICODE)?>;
|
||||
this.init_brands();
|
||||
this.get_series();
|
||||
},
|
||||
methods: {
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
|
||||
vm.brandAry = response.data;
|
||||
})
|
||||
},
|
||||
get_series: function () {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.brand_id}, function (response) {
|
||||
vm.seryAry = response.data;
|
||||
})
|
||||
},
|
||||
init_provinces: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {}, function (response) {
|
||||
@@ -438,7 +345,6 @@
|
||||
$('#search_tp').val('mobile');
|
||||
$('#title').val('');
|
||||
$('#id-create-time').val('');
|
||||
$('#id-p-time').val('');
|
||||
that.province_id = '0';
|
||||
that.city_id = '0';
|
||||
that.county_id = '0';
|
||||
@@ -447,9 +353,7 @@
|
||||
that.county_id_admin = '0';
|
||||
that.biz_id_admin = '0';
|
||||
that.cfrom_id = 0;
|
||||
that.cfrom_id = 0;
|
||||
that.brand_id = 0;
|
||||
that.series_id = 0;
|
||||
that.cfrom_id2 = 0;
|
||||
},
|
||||
export_out: function () {
|
||||
var that = this;
|
||||
@@ -468,12 +372,6 @@
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'brand_id': function (nv, ov) {
|
||||
if (nv !== '') {
|
||||
this.get_series()
|
||||
}
|
||||
|
||||
},
|
||||
'province_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
@@ -643,16 +541,13 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#batch_allot").click(function () {
|
||||
alert()
|
||||
})
|
||||
});
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-create-time', range: '~'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#id-p-time', range: '~'
|
||||
elem: '#id-en-time', range: '~'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), date = '', nowDate = new Date();
|
||||
@@ -678,15 +573,7 @@
|
||||
break;
|
||||
}
|
||||
date = beginDate + ' ~ ' + endDate;
|
||||
//$('#' + source_id).val(date);
|
||||
switch ($(this).data('btn')) {
|
||||
case 'create':
|
||||
$('#id-create-time').val(date);
|
||||
break;
|
||||
case 'p':
|
||||
$('#id-p-time').val(date);
|
||||
break;
|
||||
}
|
||||
$('#' + source_id).val(date);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -703,19 +590,6 @@
|
||||
return $.form.modal("/receiver/clues/get_adviser?ids=" + ids, 'open_type=modal', "分配顾问");
|
||||
}
|
||||
|
||||
function edit_counselor() {
|
||||
var ids = function () {
|
||||
var data = [];
|
||||
return $(".order-ids").map(function () {
|
||||
(this.checked) && data.push(this.value);
|
||||
}), data.join(',');
|
||||
}.call(this);
|
||||
if (ids.length < 1) {
|
||||
return $.msg.tips('请选择需要操作的数据!');
|
||||
}
|
||||
return $.form.modal("/receiver/clues/edit_admins?ids=" + ids, 'open_type=modal', "分配跟进人员");
|
||||
}
|
||||
|
||||
function load_clue() {
|
||||
var file = $("#clue-file");
|
||||
if (file.val() == '') {
|
||||
|
||||
@@ -44,10 +44,8 @@
|
||||
<tr>
|
||||
<td class="table-td"><span class="mr5">客户姓名:</span>{{info.name}}</td>
|
||||
<td class="table-td"><span class="mr5">客户电话:</span>{{info.mobile}}
|
||||
<a href="javascript:void(0);"
|
||||
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=customer"
|
||||
class="am-btn am-btn-sm am-btn-success ml5" data-title="获取手机号"
|
||||
v-if="info.role!=8">
|
||||
<a href="javascript:void(0);" data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=customer"
|
||||
class="am-btn am-btn-sm am-btn-success ml5" data-title="获取手机号">
|
||||
拨打
|
||||
</a>
|
||||
</td>
|
||||
@@ -63,10 +61,15 @@
|
||||
<tr>
|
||||
<td class="table-td"><span class="mr5">{{info.time_name}}:</span>{{info.p_time}}</td>
|
||||
<td class="table-td"><span class="mr5">微信好友:</span>{{info.wx_name}}</td>
|
||||
<td class="table-td"><span class="mr5">重点关注车型:</span>{{info.brand_detail}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td"><span class="mr5">平安推荐:</span>{{info.cf_name}}</td>
|
||||
<td>
|
||||
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
|
||||
<div class="text-left pt10" v-if="edit_index==2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -32,16 +32,6 @@
|
||||
<input id="cid" name="cid" type="text" v-model="params.cid"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">客户状态:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="status" v-model="params.status">
|
||||
<option value=''>请选择</option>
|
||||
<option :value="i" v-for="(v,i) in status_arr">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fl" style="width:1920px">
|
||||
<label class="am-para-label w80">客户等级:</label>
|
||||
@@ -159,20 +149,6 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl" style="width:1920px">
|
||||
<label class="am-para-label w100">重点关注车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="series_id" v-model="params.series_id">
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<? foreach ($searchTimeAry as $key => $value) { ?>
|
||||
<div id="show-<?= $key ?>" style="display:<?= $params[$key] ? 'block' : 'none' ?>">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
@@ -222,6 +198,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input name="status" value="<?= $params['status'] ?>" type="hidden">
|
||||
<input type="hidden" id="id_tags" name="tags" value="<?= $params['tags'] ?>">
|
||||
<input type="hidden" id="id_tagsIntention" name="tagsIntention" value="<?= $params['tagsIntention'] ?>">
|
||||
<input type="hidden" id="id_tagsDefeat" name="tagsDefeat" value="<?= $params['tagsDefeat'] ?>">
|
||||
@@ -234,21 +211,22 @@
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%">编号</th>
|
||||
<th width="10%"><span>客户</span></th>
|
||||
<th width="6%"><span>客户等级</span></th>
|
||||
<th width="12%"><span>客户来源</span></th>
|
||||
<th width="12%"><span>所属门店</span></th>
|
||||
<th width="10%"><span>客户来源</span></th>
|
||||
<th width="18%"><span>所属门店</span></th>
|
||||
<th width="6%"><span>车管家</span></th>
|
||||
<th width="10%"><span>关注车型</span></th>
|
||||
<th width="6%"><span>个微</span></th>
|
||||
<th width="6%"><span>状态</span></th>
|
||||
<th width="12%"><span>派单/建档时间</span></th>
|
||||
<th width="12%"><span>最后联系时间</span></th>
|
||||
<th width="15%"><span>派单/建档时间</span></th>
|
||||
<th width="15%"><span>最后联系时间</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr>
|
||||
<td style="vertical-align: middle;">{{v.cid}}</td>
|
||||
<td style="vertical-align: middle;"><a href="javascript:void(0);"
|
||||
:data-open="'/receiver/customer/get?id='+v.id">{{v.name}}<br>{{v.mobile_sub}}</a>
|
||||
</td>
|
||||
@@ -256,7 +234,6 @@
|
||||
<td style="vertical-align: middle;">{{v.of_title}}</td>
|
||||
<td style="vertical-align: middle;">{{v.biz_poi}}<br>{{v.biz_name}}</td>
|
||||
<td style="vertical-align: middle;">{{v.admin_name}}</td>
|
||||
<td style="vertical-align: middle;">{{v.brand_detail}}</td>
|
||||
<td style="vertical-align: middle;">{{v.wxgr_name}}</td>
|
||||
<td style="vertical-align: middle;">{{v.status_name}}</td>
|
||||
<td style="vertical-align: middle;">{{v.p_time}}</td>
|
||||
@@ -425,14 +402,12 @@
|
||||
searchTpAry: [],
|
||||
lists: [],
|
||||
qdjl_lists: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
admins: {
|
||||
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
bizAry: [],
|
||||
list: [],
|
||||
list: []
|
||||
},
|
||||
show_info: {
|
||||
levelAry: [],
|
||||
@@ -451,38 +426,17 @@
|
||||
provinceAry: [],
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
status_arr: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.searchTpAry = <?=json_encode($searchTpAry)?>;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.status_arr = <?=json_encode($status_arr)?>;
|
||||
vm.qdjl_lists = <?=json_encode($qdjl_lists)?>;
|
||||
vm.show_info = <?=json_encode($show_info)?>;
|
||||
vm.export_button = <?=$export_button?>;
|
||||
vm.init_brands();
|
||||
vm.get_series()
|
||||
},
|
||||
methods: {
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
|
||||
vm.brandAry = response.data;
|
||||
})
|
||||
},
|
||||
get_series: function () {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.params.brand_id}, function (response) {
|
||||
vm.seryAry = response.data;
|
||||
// if (if_reset) {
|
||||
// vm.params.series_id = 0;
|
||||
// vm.params.car_id = 0;
|
||||
// }
|
||||
})
|
||||
},
|
||||
btnTimes: function () {
|
||||
layer.open({
|
||||
type: 1,
|
||||
@@ -676,8 +630,6 @@
|
||||
that.params.county_id_admin = '';
|
||||
that.params.of_id = '';
|
||||
that.params.of2_id = '';
|
||||
that.params.brand_id = 0;
|
||||
that.params.series_id = 0;
|
||||
$('#id_tags').val('');
|
||||
$('#id_tagsIntention').val('');
|
||||
$('#id_tagsDefeat').val('');
|
||||
@@ -708,13 +660,6 @@
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'params.brand_id': function (nv, ov) {
|
||||
console.log("brand_id", nv, ov)
|
||||
if (nv !== '') {
|
||||
this.get_series()
|
||||
}
|
||||
|
||||
},
|
||||
'params.province_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="am-form-group clearfix" v-if="parseInt(info.if_equity)">
|
||||
<div class="am-form-group clearfix">
|
||||
<p class="am-text-default mb10 ml30 pt15 pb10">
|
||||
权益确认书:
|
||||
</p>
|
||||
@@ -196,9 +196,7 @@
|
||||
onclick="del_img('data','insurance_img','')">x
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<embed type="application/pdf" v-if="info.img_data.insurance_pdf" alt="交强险"
|
||||
:src="info.img_data.insurance_pdf"/>
|
||||
<img v-else alt="交强险险" onclick="showViewer('viewer-insurance_img')"
|
||||
<img alt="交强险" onclick="showViewer('viewer-insurance_img')"
|
||||
:src="info.img_data.insurance_img"/>
|
||||
</a>
|
||||
<div class="f12 tc">交强险</div>
|
||||
@@ -217,9 +215,7 @@
|
||||
onclick="del_img('data','business_img','')">x
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<embed type="application/pdf" v-if="info.img_data.business_pdf" alt="交强险"
|
||||
:src="info.img_data.business_pdf"/>
|
||||
<img v-else alt="商业险" onclick="showViewer('viewer-insurance_img')"
|
||||
<img alt="商业险" onclick="showViewer('viewer-insurance_img')"
|
||||
:src="info.img_data.business_img"/>
|
||||
</a>
|
||||
<div class="f12 tc">商业险</div>
|
||||
@@ -261,7 +257,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--div class="am-form-group clearfix">
|
||||
<div class="am-form-group clearfix">
|
||||
<div class="">
|
||||
<p class="am-text-default mb10 ml30 pt15 pb10">
|
||||
实名认证:
|
||||
@@ -286,7 +282,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div-->
|
||||
</div>
|
||||
|
||||
<!--div class="am-form-group clearfix">
|
||||
<div class="">
|
||||
|
||||
@@ -109,25 +109,19 @@
|
||||
</div>
|
||||
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">建档时间:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.p_time}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">下单时间:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.c_time}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">订单状态:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.status_name}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">客户来源:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.of_title}}</label>
|
||||
|
||||
@@ -92,15 +92,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">投保买贵必赔:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{parseInt(info.if_equity) ? '是':'否'}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,35 +86,12 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">是否有合同:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="iscontract">
|
||||
<option value="">请选择</option>
|
||||
<option value="1" <?php if ($params['iscontract'] == 1){ ?>selected <?php } ?>>是</option>
|
||||
<option value="2" <?php if ($params['iscontract'] == 2){ ?>selected <?php } ?>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">是否开票:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="isbill">
|
||||
<option value="">请选择</option>
|
||||
<option value="1" <?php if ($params['isbill'] == 1){ ?>selected <?php } ?>>是</option>
|
||||
<option value="2" <?php if ($params['isbill'] == 2){ ?>selected <?php } ?>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline">
|
||||
<select class="selectpicker" name="brand_id" v-model="params.brand_id" data-live-search="true">
|
||||
<option value="0">所有品牌</option>
|
||||
<? foreach ($brands as $v) { ?>
|
||||
<option value="<?= $v['id'] ?>"><?= $v['name'] ?></option>
|
||||
<? } ?>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
@@ -175,15 +152,6 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<label class="am-para-label w100">CPS品牌:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="cps_type" v-model="params.cps_type">
|
||||
<option value=''>请选择</option>
|
||||
<option v-for="(v,i) in cps_types" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml10">
|
||||
@@ -232,7 +200,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete', 'bootstrap-select'], function (laydate) {
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-create-time', range: '~'
|
||||
});
|
||||
@@ -281,9 +249,8 @@
|
||||
break;
|
||||
}
|
||||
});
|
||||
$('.selectpicker').selectpicker();
|
||||
|
||||
});
|
||||
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
@@ -299,25 +266,23 @@
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
bizAry: [],
|
||||
list: [],
|
||||
list: []
|
||||
},
|
||||
lists: [],
|
||||
of2Ary: [],
|
||||
cps_types: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.show_info = <?=json_encode($show_info)?>;
|
||||
// vm.init_brands();
|
||||
vm.init_brands();
|
||||
if (vm.params.series_id) {
|
||||
this.get_series()
|
||||
}
|
||||
if (vm.params.car_id) {
|
||||
this.get_car()
|
||||
}
|
||||
vm.cps_types = <?=json_encode($cps_types, JSON_UNESCAPED_UNICODE)?>;
|
||||
},
|
||||
methods: {
|
||||
export_out: function (type) {
|
||||
@@ -373,7 +338,6 @@
|
||||
that.params.county_id_id_admin = '';
|
||||
that.params.biz_id_id_admin = '';
|
||||
that.params.qdjl_id = '';
|
||||
that.params.cps_type = '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;margin-bottom: 20px;">
|
||||
</div>
|
||||
<div class="coms-table-wrap mt10" id="vue-app">
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/receiver/report">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">门店:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline">
|
||||
<select class="selectpicker" name="biz_id" data-live-search="true">
|
||||
<option value="0">所有门店</option>
|
||||
<? foreach ($biz_lists as $item) { ?>
|
||||
<option value="<?= $item['id'] ?>" <?= $item['id'] == $params['biz_id'] ? 'selected' : '' ?>><?= $item['biz_name'] ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<label class="am-para-label w100">日期:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline">
|
||||
<input id="id-day" name="day" type="text" value="<?= $params['day'] ?>"
|
||||
placeholder="选择日期" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索
|
||||
</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" onclick="export_out()" class="am-btn am-btn-success am-btn-sm w100">导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="coms-table-bd" id="vue-show">
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>车卖场</span></th>
|
||||
<th><span>日期</span></th>
|
||||
<th><span>顾问数(含店长)</span></th>
|
||||
<th><span>开工率</span></th>
|
||||
<th><span>新增线索数</span></th>
|
||||
<th><span>未及时分配数</span></th>
|
||||
<th><span>新增跟进数</span></th>
|
||||
<th><span>线索逾期数</span></th>
|
||||
<th><span>战败申请未处理数</span></th>
|
||||
<th><span>订单新增数</span></th>
|
||||
<th><span>订单未达T+1</span></th>
|
||||
<th><span>开票早与订单时间数</span></th>
|
||||
<th><span>交付总数</span></th>
|
||||
<th><span>运营分</span></th>
|
||||
<th><span></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td rowspan="2" style="vertical-align: middle;"><?= $v['biz_name'] ?></td>
|
||||
<td rowspan="2" style="vertical-align: middle;"><?= $v['day'] ?></td>
|
||||
<td rowspan="2" style="vertical-align: middle;"><?= $v['sales'] ?></td>
|
||||
<td><?= intval($v['work_per']) ?>%</td>
|
||||
<td><?= $v['cust_new'] ?></td>
|
||||
<td><?= $v['cust_push'] ?></td>
|
||||
<td><?= $v['cust_visit'] ?></td>
|
||||
<td><?= $v['cust_delay'] ?></td>
|
||||
<td><?= $v['cust_defeat'] ?></td>
|
||||
<td><?= $v['order_new'] ?></td>
|
||||
<td><?= $v['order_wrong'] ?></td>
|
||||
<td><?= $v['order_early'] ?></td>
|
||||
<td></td>
|
||||
<td><?= $v['score'] ?></td>
|
||||
<td>今日</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= intval($v['work_per_month']) ?>%</td>
|
||||
<td><?= $v['cust_month'] ?></td>
|
||||
<td><?= $v['cust_push_month'] ?></td>
|
||||
<td><?= $v['cust_visit_month'] ?></td>
|
||||
<td><?= $v['cust_delay_month'] ?></td>
|
||||
<td><?= $v['cust_defeat_month'] ?></td>
|
||||
<td><?= $v['order_month'] ?></td>
|
||||
<td><?= $v['order_wrong_month'] ?></td>
|
||||
<td><?= $v['order_finish'] ?></td>
|
||||
<td><?= $v['order_over'] ?></td>
|
||||
<td><?= $v['score_month'] ?></td>
|
||||
<td>本月</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
optionsList: [],
|
||||
},
|
||||
mounted: function () {
|
||||
},
|
||||
methods: {},
|
||||
watch: {}
|
||||
});
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
require(['laydate', 'bootstrap-select'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-day'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), date = '', nowDate = new Date();
|
||||
var date = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
|
||||
$('#id-day').val(date);
|
||||
});
|
||||
$('.selectpicker').selectpicker();
|
||||
});
|
||||
|
||||
function export_out() {
|
||||
var href = $.menu.parseUri(window.location.href);
|
||||
var day = $('#id-day').val();
|
||||
href = href.replace("report?", "report/export?day=" + day + "&");
|
||||
window.location.href = href;
|
||||
}
|
||||
</script>
|
||||
@@ -57,10 +57,6 @@
|
||||
<label class="am-para-label">门店:</label>
|
||||
<div class="am-para-inline" style="width:80%">
|
||||
<div>
|
||||
<select style="width:100px;display:inline" v-model="province_id">
|
||||
<option value="">选择省份</option>
|
||||
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
|
||||
</select>
|
||||
<select style="width:100px;display:inline" v-model="city_id">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
||||
@@ -94,10 +90,8 @@
|
||||
data: {
|
||||
role_id: '',
|
||||
role: <?=json_encode($this->data['role'])?>,
|
||||
province_id: '<?=$province_id?>',
|
||||
city_id:'<?=$city_id?>',
|
||||
county_id: '<?=$county_id?>',
|
||||
provinceAry:[],
|
||||
cityAry:[],
|
||||
countyAry:[],
|
||||
bizAry:[],
|
||||
@@ -114,9 +108,9 @@
|
||||
methods: {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.get('/common/area',{'id':350,'key':'province','province_limit':true},function(response){
|
||||
$.get('/common/area',{'id':350,'key':'city','type':1},function(response){
|
||||
if (response.code == 1) {
|
||||
vm.provinceAry = response.data;
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -150,21 +144,6 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'province_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.cityAry = [];
|
||||
that.city_id = '';
|
||||
that.countyAry = [];
|
||||
that.county_id = '';
|
||||
} else {
|
||||
$.get('/common/area',{'id':nv,'key':'city','type':1},function(response){
|
||||
if (response.code == 1) {
|
||||
that.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
@@ -180,7 +159,7 @@
|
||||
},
|
||||
'county_id': function (nv, ov) {
|
||||
var that = this;
|
||||
$.get('/biz/store/store/json_lists',{city_id:that.city_id,county_id:that.county_id,status:1},function(response){
|
||||
$.post('/biz/store/store/json_lists',{city_id:that.city_id,county_id:that.county_id,status:1},function(response){
|
||||
if (response.code == 1) {
|
||||
$.each(response.data.list,function(key,val){
|
||||
response.data.list[key]['selected'] = ''
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
<form id="vue-app" class="am-form am-form-horizontal" action="/biz/store/store/add?>" data-auto="true" method="post"
|
||||
style="width: 90%;padding-top: 10px">
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">品牌:</label>
|
||||
<div class="am-para-input w200">
|
||||
<select class="selectpicker" v-model="info.brand_id" data-live-search="true">
|
||||
<option v-for="value in brands" :value="value.id">{{value.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">类型:</label>
|
||||
<div class="am-para-input w200">
|
||||
<select v-model="info.type">
|
||||
<option v-for="(value,index) in types" :value="index">{{value}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">有效时间:</label>
|
||||
<div class="am-para-input wp60">
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" placeholder="开始时间" v-model="info.s_time" name="s_time"
|
||||
id="datetimepicker1" autocomplete="off">
|
||||
</div>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" placeholder="结束时间" v-model="info.e_time" name="e_time" id="datetimepicker2"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-success" type="button" @click="submit">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var vm = new Vue({
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
info: <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>,
|
||||
brands: <?=json_encode($brands, JSON_UNESCAPED_UNICODE)?>,
|
||||
types: <?=json_encode($types, JSON_UNESCAPED_UNICODE)?>,
|
||||
},
|
||||
mounted: function () {
|
||||
},
|
||||
methods: {
|
||||
submit: function () {
|
||||
let url = "sys/cps/brand/add"
|
||||
if (this.info.id) {
|
||||
url = "sys/cps/brand/edit"
|
||||
}
|
||||
var brand_id = $('.selectpicker').val();
|
||||
if (!brand_id) {
|
||||
layer.msg("请选择品牌", {icon: 2})
|
||||
return
|
||||
}
|
||||
if (!this.info.type) {
|
||||
layer.msg("请选择类型", {icon: 2})
|
||||
return
|
||||
}
|
||||
if (!this.info.s_time || !this.info.e_time) {
|
||||
layer.msg("请选择有效期时间", {icon: 2})
|
||||
return
|
||||
}
|
||||
this.info.brand_id = brand_id
|
||||
$.post(url, this.info, function (data) {
|
||||
if (data.code) {
|
||||
layer.msg(data.msg, {
|
||||
icon: 1, end: function () {
|
||||
window.onhashchange.call();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
})
|
||||
},
|
||||
set_Stime: function (value) {
|
||||
this.info.s_time = value
|
||||
},
|
||||
set_Etime: function (value) {
|
||||
this.info.e_time = value
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
},
|
||||
watch: {}
|
||||
});
|
||||
require(['laydate', 'bootstrap-select'], function (laydate, bootstrapSelect) {
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#datetimepicker1',
|
||||
type: 'date',
|
||||
done: function (value, date) {
|
||||
vm.set_Stime(value)
|
||||
}
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#datetimepicker2',
|
||||
type: 'date',
|
||||
done: function (value, date) {
|
||||
vm.set_Etime(value)
|
||||
}
|
||||
});
|
||||
$('.selectpicker').selectpicker();
|
||||
});
|
||||
</script>
|
||||
@@ -1,103 +0,0 @@
|
||||
<div class="coms-table-wrap mt10" id="vue-app">
|
||||
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="sys/cps/brand">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">状态:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="status" v-model="params.status">
|
||||
<option value="">选择状态</option>
|
||||
<option v-for="(value,key) in status_lists" :value="key">
|
||||
{{value}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">类型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="type" v-model="params.type">
|
||||
<option value="">选择状态</option>
|
||||
<option v-for="(value,key) in type_lists" :value="key">
|
||||
{{value}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml30">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button data-open="/sys/cps/brand/get" type="button" data-title="新增"
|
||||
class="am-btn am-btn-success am-btn-sm w100">
|
||||
新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="coms-table-bd" id="vue-show">
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="8%"><span>id</span></th>
|
||||
<th><span>品牌</span></th>
|
||||
<th width="15%"><span>开始时间</span></th>
|
||||
<th width="15%"><span>结束时间</span></th>
|
||||
<th width="10%"><span>类型</span></th>
|
||||
<th width="10%"><span>状态</span></th>
|
||||
<th width="10%"><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="value in lists">
|
||||
<tr>
|
||||
<td>{{value.id}}</td>
|
||||
<td>{{value.brand_name}}</td>
|
||||
<td>{{value.s_time}}</td>
|
||||
<td>{{value.e_time}}</td>
|
||||
<td>{{value.type_name}}</td>
|
||||
<td>{{value.status_name}}</td>
|
||||
<td>
|
||||
<button data-action="/sys/cps/brand/edit_status" data-ajax="post" :data-params-id="value.id"
|
||||
class="am-btn am-btn-danger am-btn-xs">
|
||||
{{value.status==1?'禁用':'启用'}}
|
||||
</button>
|
||||
<button :data-open="'/sys/cps/brand/get?id='+value.id" class="am-btn am-btn-success am-btn-xs">
|
||||
修改
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
params: <?=json_encode($params, JSON_UNESCAPED_UNICODE)?>,
|
||||
status_lists: <?=json_encode($status_lists, JSON_UNESCAPED_UNICODE)?>,
|
||||
type_lists: <?=json_encode($type_lists, JSON_UNESCAPED_UNICODE)?>,
|
||||
lists: <?=json_encode($lists, JSON_UNESCAPED_UNICODE)?>,
|
||||
},
|
||||
mounted: function () {
|
||||
},
|
||||
methods: {},
|
||||
watch: {}
|
||||
});
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
</script>
|
||||
@@ -1,113 +0,0 @@
|
||||
<form id="vue-edit" class="am-form am-form-horizontal" action="/sys/yx/mobile/<?= $url ?>" data-auto="true"
|
||||
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
|
||||
<input type="hidden" v-model="row.id" name="id"/>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">手机号:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="输入手机号" v-model="row.mobile" name="mobile"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">城市:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="province_id" v-model="province_id">
|
||||
<option value="0">省份</option>
|
||||
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="city_id" v-model="city_id">
|
||||
<option value="0">城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">保存
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-edit',
|
||||
data: {
|
||||
row: <?=$row ? json_encode($row, JSON_UNESCAPED_UNICODE) : '[]'?>,
|
||||
province_id: <?=$row['province_id'] ? $row['province_id'] : 0?>,
|
||||
city_id: <?=$row['city_id'] ? $row['city_id'] : 0?>,
|
||||
provinceAry: [],
|
||||
cityAry: []
|
||||
},
|
||||
mounted: function () {
|
||||
this.init_provinces();
|
||||
this.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_provinces: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.provinceAry = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {id: vm.province_id, key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'province_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.cityAry = [];
|
||||
that.city_id = '0';
|
||||
} else {
|
||||
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
that.cityAry = response.data;
|
||||
if (that.city_id > 0) {
|
||||
var city_id = '0';
|
||||
for (var i in that.cityAry) {
|
||||
var city = that.cityAry[i];
|
||||
if (city.id == that.city_id) {
|
||||
city_id = city.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.city_id = city_id;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.countyAry = [];
|
||||
that.county_id = '0';
|
||||
} else {
|
||||
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
that.countyAry = response.data;
|
||||
if (that.county_id > 0) {
|
||||
var county_id = '0';
|
||||
for (var i in that.countyAry) {
|
||||
var county = that.countyAry[i];
|
||||
if (county.id == that.county_id) {
|
||||
county_id = county.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.county_id = county_id;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,31 +0,0 @@
|
||||
<form id="vue-edit" class="am-form am-form-horizontal" action="/sys/yx/mobile/edit_admin" data-auto="true"
|
||||
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
|
||||
<input type="hidden" v-model="row.id" name="id"/>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">管理员:</label>
|
||||
<div class="am-form-group am-para-inline w300">
|
||||
<select name="admin_id" v-model="row.admin_id">
|
||||
<option value="0">选择管理员</option>
|
||||
<option :value="v.id" v-for="(v,i) in adminLists">{{v.username}}({{v.mobile}})</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">保存
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-edit',
|
||||
data: {
|
||||
row: <?=$row ? json_encode($row, JSON_UNESCAPED_UNICODE) : '[]'?>,
|
||||
adminLists: <?=$adminLists ? json_encode($adminLists, JSON_UNESCAPED_UNICODE) : '[]'?>
|
||||
},
|
||||
mounted: function () {
|
||||
|
||||
},
|
||||
methods: {},
|
||||
watch: {}
|
||||
});
|
||||
</script>
|
||||
@@ -1,92 +0,0 @@
|
||||
<div class="coms-table-wrap">
|
||||
<!-- no-border 去掉头部就有边控了-->
|
||||
<div class="coms-table-hd clearfix no-border">
|
||||
<form action="/sys/yx/mobile/lists" class="form-search" onsubmit="return false">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label">手机号</label>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" value="<?= $mobile ?>" name="mobile"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<button type="submit" class="am-btn ml20 am-btn-sm am-btn-success w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<button type="button" data-modal="/sys/yx/mobile/get" data-title="新增"
|
||||
class="add am-btn ml20 am-btn-sm am-btn-success w100">新增
|
||||
</button>
|
||||
</div>
|
||||
<div class="am-form-group fr" style="font-size: 15px;padding-right: 20px;padding-top: 6px;">
|
||||
共有<?= $pager['total'] ?>条数据
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="coms-table-bd">
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="8%"><span>ID</span></th>
|
||||
<th width="20%"><span>手机号</span></th>
|
||||
<th width="20%"><span>城市</span></th>
|
||||
<th width="20%"><span>绑定管理员</span></th>
|
||||
<th width="8%"><span>状态</span></th>
|
||||
<th><span>操作</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="value in lists">
|
||||
<!-- <td><input type="checkbox" /></td> -->
|
||||
<td>{{value.id}}</td>
|
||||
<td>{{value.mobile}}</td>
|
||||
<td>{{value.province_name}}-{{value.city_name}}</td>
|
||||
<td>{{value.admin_name}}</td>
|
||||
<td>{{ value.status==1 ? '正常': '禁用'}}</td>
|
||||
<td>
|
||||
<a v-if="value.status == 1" @click="editStatus(value.id,0)"
|
||||
class="am-btn am-btn-danger am-btn-xs">禁用</a>
|
||||
<a v-else @click="editStatus(value.id,1)" class="am-btn am-btn-danger am-btn-xs">启用</a>
|
||||
<a :data-modal="'/sys/yx/mobile/get?id='+value.id"
|
||||
class="am-btn am-btn-primary am-btn-xs">修改</a>
|
||||
<a :data-modal="'/sys/yx/mobile/edit_admin?id='+value.id"
|
||||
class="am-btn am-btn-primary am-btn-xs">{{value.admin_id>0 ? '修改绑定管理员' :'绑定管理员'}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php call_user_func_array('page_view', $this->data['pager']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var modal = $('#add-new');
|
||||
$('.add').on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
modal.modal();
|
||||
});
|
||||
var vm = new Vue({
|
||||
el: '.coms-table-bd',
|
||||
data: {
|
||||
lists: JSON.parse('<?=json_encode($this->data['lists'])?>'),
|
||||
},
|
||||
methods: {
|
||||
editStatus: function (index, status) {
|
||||
$.post('sys/yx/mobile/edit_status', {id: index, status: status}, function (data) {
|
||||
setTimeout(function () {
|
||||
if (data.code == '1') {
|
||||
layer.alert(data.msg, {icon: 1});
|
||||
window.onhashchange.call();
|
||||
} else {
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -7,7 +7,13 @@
|
||||
* Time: 11:32
|
||||
*/
|
||||
|
||||
$config['app_id'] = 1428;
|
||||
$config['app_key'] = 'S3WMWHBGKSDZP5SYYVDV4JZK';
|
||||
$config['app_id'] = 1216;
|
||||
$config['app_key'] = 'V44SK7UJMUN1SH9FETN8QRT2';
|
||||
|
||||
$config['mobile_list'] = [];
|
||||
$config['mobile_list'] = array(
|
||||
'18017420332','18017414423','15317304631','15317106841',
|
||||
'15317082243','15317373459','15317373449','15317373340',
|
||||
'15317373147','15317373143','15317372640','15317371423',
|
||||
'15317371412','15317371405','15317370437','15317368843',
|
||||
'15317367941','15317367402','15317364837',
|
||||
);
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
//ini_set("display_errors", "On");//打开错误提示
|
||||
//ini_set("error_reporting",E_ALL);//显示所有错误
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Clues extends CI_Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$post = $this->input->post();
|
||||
$input = json_decode(file_get_contents('php://input'), true);
|
||||
debug_log(json_encode($post), 'clues.txt');
|
||||
debug_log(json_encode($input), 'clues.txt');
|
||||
|
||||
if($input){
|
||||
|
||||
}
|
||||
|
||||
$return = array(
|
||||
'code' => 1,
|
||||
'content' => null,
|
||||
'msg' => '',
|
||||
);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -31,14 +31,6 @@ class Plan extends CI_Controller
|
||||
$plan[] = array('url' => base_url(array('plan', 'yxcall', 'down_video')), 'interval' => 5); //下载录音文件
|
||||
//$plan[] = array('url' => base_url(array('plan', 'licheb', 'users_log')), 'interval' => 2);//顾问日志
|
||||
//$plan[] = array('url' => base_url(array('plan', 'licheb', 'bizs_log')), 'interval' => 2);//门店日志
|
||||
$plan[] = array('url' => base_url(array('plan', 'score', 'index')), 'interval' => 1); //统计分数
|
||||
$plan[] = array('url' => base_url(array('plan', 'score', 'scoreDay')), 'interval' => 1); //合并分数日志
|
||||
$plan[] = array('url' => base_url(array('plan', 'score', 'mergeUser')), 'interval' => 1); //合并上月个人分数日志
|
||||
$plan[] = array('url' => base_url(array('plan', 'score', 'mergeBiz')), 'interval' => 1); //合并上月门店分数日志
|
||||
$plan[] = array('url' => base_url(array('plan', 'score', 'mergeAvgUser')), 'interval' => 1); //合并本月个人分数日志
|
||||
$plan[] = array('url' => base_url(array('plan', 'score', 'mergeAvgBiz')), 'interval' => 1); //合并本月门店分数日志
|
||||
|
||||
$plan[] = array('url' => base_url(array('plan', 'report', 'index')), 'interval' => 20); //门店日报
|
||||
|
||||
$this->plan = $plan;
|
||||
}
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 报表数据
|
||||
*/
|
||||
class Report extends HD_Controller
|
||||
{
|
||||
private $log_dir = 'biz_report';
|
||||
private $biz_type = '1,2';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model("biz/biz_report_day_model");
|
||||
$this->load->model('receiver/receiver_score_log_model');
|
||||
$this->load->model('receiver/receiver_score_day_model');
|
||||
$this->load->model('receiver/receiver_score_avg_day_model');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model('receiver/receiver_customers_model');
|
||||
$this->load->model('receiver/order/receiver_orders_model');
|
||||
$this->load->model('receiver/order/receiver_order_datas_model');
|
||||
}
|
||||
|
||||
//报表统计
|
||||
public function index()
|
||||
{
|
||||
$day = $this->input->get('day');
|
||||
!$day && $day = date('Y-m-d', strtotime('yesterday'));
|
||||
$month = date('Y-m', strtotime($day));
|
||||
$getPage = $this->input->get('page');
|
||||
$size = $this->input->get('size');
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$h = date('H');
|
||||
if (!$t_limit && $h > 5) {
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "BIZ_REPORT_DAY";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
!$size && $size = 20;
|
||||
|
||||
$where = array(
|
||||
'status' => 1,
|
||||
"type in ({$this->biz_type})" => null,
|
||||
'province_id' => 350000
|
||||
);
|
||||
$bizs = $this->biz_model->select($where, '', $page, $size, 'id, biz_name');
|
||||
if ($bizs) {
|
||||
foreach ($bizs as $v) {
|
||||
//开工率
|
||||
$sales = $this->app_licheb_users_model->count(array('group_id in (1,2)' => null, 'biz_id' => $v['id'], 'status' => 1));
|
||||
$works = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 0, 'sub_type' => 0, 'score >' => 0));
|
||||
|
||||
//今日新增线索数
|
||||
$cust_new = $this->receiver_customers_model->count(array('biz_id' => $v['id'], 'DATE(p_time)' => $day));
|
||||
|
||||
//本月线索总数
|
||||
$cust_month = $this->receiver_customers_model->count(array('biz_id' => $v['id'], "DATE_FORMAT(`p_time`, '%Y-%m') = '{$month}'" => null));
|
||||
|
||||
|
||||
//今日新增跟进数
|
||||
$cust_visit = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 1, 'sub_type' => 2, 'target_id >' => 0));
|
||||
|
||||
//本月跟进客户数
|
||||
$cust_visit_month = $this->receiver_score_log_model->count(array("DATE_FORMAT(`day`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'type' => 1, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//今日订单新增数
|
||||
$order_new = $this->receiver_orders_model->count(array('DATE(order_time)' => $day, 'biz_id' => $v['id'], 'status >=' => 0));
|
||||
|
||||
//本月订单总数
|
||||
$order_month = $this->receiver_orders_model->select(array("DATE_FORMAT(`order_time`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'status >=' => 0), '', 0, 0, 'id');
|
||||
|
||||
|
||||
//本月订单信息完整数
|
||||
if ($order_month) {
|
||||
$oids = implode(',', array_unique(array_column($order_month, 'id')));
|
||||
|
||||
$where = array(
|
||||
"o_id in ({$oids})" => null,
|
||||
"((cardida != '' AND cardidb != '') OR (business_licence != ''))" => null,
|
||||
"pay_img <>" => '',
|
||||
"contract_img <>" => '',
|
||||
"bill_img <>" => '',
|
||||
"car_img <>" => '',
|
||||
"insurance_img <>" => '',
|
||||
"business_img <>" => '',
|
||||
);
|
||||
$order_finish = $this->receiver_order_datas_model->count($where);
|
||||
} else {
|
||||
$order_finish = 0;
|
||||
}
|
||||
|
||||
//今日线索逾期数
|
||||
$cust_delay = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 3, 'target_id >' => 0));
|
||||
//本月开工
|
||||
$works_month = $this->receiver_score_log_model->count(array("DATE_FORMAT(`day`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'type' => 0, 'sub_type' => 0, 'score >' => 0), 'biz_id,uid');
|
||||
//本月线索逾期数
|
||||
$cust_delay_month = $this->receiver_score_log_model->count(array("DATE_FORMAT(`day`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 3, 'target_id >' => 0));
|
||||
|
||||
//今日订单未达T+1
|
||||
$order_wrong = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//本月订单未达T+1
|
||||
$order_wrong_month = $this->receiver_score_log_model->count(array("DATE_FORMAT(`day`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//今日开票早与订单时间数
|
||||
$order_early = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 1, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//今日未及时分配数
|
||||
$cust_push = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 4, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//本月未及时分配数
|
||||
$cust_push_month = $this->receiver_score_log_model->count(array("DATE_FORMAT(`day`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 4, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//今日战败申请未处理数
|
||||
$cust_defeat = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 5, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//本月战败申请未处理数
|
||||
$cust_defeat_moth = $this->receiver_score_log_model->count(array("DATE_FORMAT(`day`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 5, 'target_id >' => 0), 'target_id');
|
||||
|
||||
//本月交付总数
|
||||
$order_over = $this->receiver_orders_model->count(array("DATE_FORMAT(`over_time`, '%Y-%m') = '{$month}'" => null, 'biz_id' => $v['id'], 'status >' => 0));
|
||||
|
||||
//今日运营分
|
||||
$score = $this->receiver_score_day_model->get(array('day' => $day, 'biz_id' => $v['id'], 'type' => 1));
|
||||
|
||||
//本月运营分
|
||||
$score_month = $this->receiver_score_avg_day_model->get(array('day' => $day, 'biz_id' => $v['id'], 'uid' => 0));
|
||||
|
||||
$data = [
|
||||
'sales' => $sales,
|
||||
'work_per' => number_format($works / $sales, 2) * 100,
|
||||
'cust_new' => $cust_new,
|
||||
'cust_push' => $cust_push,
|
||||
'cust_visit' => $cust_visit,
|
||||
'cust_delay' => $cust_delay,
|
||||
'cust_defeat' => $cust_defeat,
|
||||
'order_new' => $order_new,
|
||||
'order_wrong' => $order_wrong,
|
||||
'order_early' => $order_early,
|
||||
'score' => round($score['score']),
|
||||
|
||||
'work_per_month' => number_format($works_month / $sales, 2) * 100,
|
||||
'cust_month' => $cust_month,
|
||||
'cust_push_month' => $cust_push_month,
|
||||
'cust_visit_month' => $cust_visit_month,
|
||||
'cust_delay_month' => $cust_delay_month,
|
||||
'cust_defeat_month' => $cust_defeat_moth,
|
||||
'order_month' => count($order_month),
|
||||
'order_wrong_month' => $order_wrong_month,
|
||||
'order_over' => $order_over,
|
||||
'order_finish' => $order_finish,
|
||||
'score_month' => round($score_month['score']),
|
||||
'day' => $day,
|
||||
];
|
||||
$row = $this->biz_report_day_model->get(['biz_id' => $v['id'], 'day' => $day]);
|
||||
if ($row) {
|
||||
$this->biz_report_day_model->update($data, ['id' => $row['id']]);
|
||||
} else {
|
||||
$data['biz_id'] = $v['id'];
|
||||
$data['c_time'] = time();
|
||||
$this->biz_report_day_model->add($data);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,575 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Score extends HD_Controller
|
||||
{
|
||||
private $log_dir = 'receiver_score';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/receiver_score_log_model');
|
||||
$this->load->model('receiver/receiver_score_config_model');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->library('receiver/score_entity');
|
||||
$this->load->model('receiver/receiver_score_day_model');
|
||||
$this->load->model('receiver/receiver_score_month_model');
|
||||
$this->load->model('receiver/receiver_score_avg_day_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$biz_id = $this->input->get('biz_id');
|
||||
$uid = $this->input->get('uid');
|
||||
$getPage = $this->input->get('page');
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$h = date('H');
|
||||
if (!$t_limit && $h > 5) {
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_PLAN_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 20;
|
||||
$groups_string = implode(',', [App_licheb_users_model::GROUP_BIZ, App_licheb_users_model::GROUP_MANAGER]);
|
||||
$where = [
|
||||
"group_id in ({$groups_string})" => null,
|
||||
'status' => 1
|
||||
];
|
||||
$biz_id && $where['biz_id'] = $biz_id;
|
||||
$uid && $where['id'] = $uid;
|
||||
$rows = $this->app_licheb_users_model->select($where, "id desc", $page, $size, 'id, uname, biz_id, group_id');
|
||||
if ($rows) {
|
||||
$day = date('Y-m-d', strtotime("-1 day"));
|
||||
foreach ($rows as $item) {
|
||||
$result = Score_entity::init($day, $item['id'], $item['group_id'], $item['biz_id']);
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
|
||||
//每日统计
|
||||
public function scoreDay()
|
||||
{
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$h = date('H');
|
||||
if (!$t_limit && $h > 5) {
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$getPage = $this->input->get('page');
|
||||
$day = date('Y-m-d', strtotime("-1 day"));
|
||||
$scoreLogModel = new Receiver_score_log_model();
|
||||
$receiverScoreDayModel = new Receiver_score_day_model();
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_DAY_USER_PLAN_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 50;
|
||||
$where = [
|
||||
'day' => $day,
|
||||
];
|
||||
$rows = $scoreLogModel->select($where, "id desc", $page, $size, 'DISTINCT biz_id,uid,day');
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'uid' => $item['uid'],
|
||||
'day' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$scoreDayRow = $receiverScoreDayModel->get($where);
|
||||
$scoreSum = $scoreLogModel->sum('score', ['uid' => $item['uid'], 'day' => $day]);
|
||||
$score = $scoreSum ? $scoreSum['score'] : 0;
|
||||
//获取上一天数据
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'uid' => $item['uid'],
|
||||
'day<' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$dayRow = $receiverScoreDayModel->select($where, 'day desc', 1, 1, 'score');
|
||||
$change_score = $dayRow[0]['score'] ? $score - $dayRow[0]['score'] : $score;
|
||||
if ($scoreDayRow) {
|
||||
$receiverScoreDayModel->update(['score' => $score, 'change_score' => $change_score], ['id' => $scoreDayRow['id']]);
|
||||
} else {
|
||||
$biz = $this->biz_model->get(['id' => $item['biz_id']]);
|
||||
$addData = [
|
||||
'biz_id' => $item['biz_id'], 'uid' => $item['uid'],
|
||||
'score' => $score, 'day' => $day, 'type' => Receiver_score_day_model::TYPE_USER,
|
||||
'change_score' => $change_score, 'c_time' => time(),
|
||||
'province_id' => $biz['province_id'] ?: 0,
|
||||
];
|
||||
$receiverScoreDayModel->add($addData);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else { //合并门店数据
|
||||
$finishCacheKey = "RECEIVER_SCORE_DAY_USER_FINISH";
|
||||
if ($redis->get($finishCacheKey)) {
|
||||
$msg = '用户合并统计数据执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
echo "开始执行店铺合并数据";
|
||||
$redis->set($finishCacheKey, 1, 6 * 60 * 60);
|
||||
}
|
||||
$this->scoreBizDay($day);
|
||||
}
|
||||
}
|
||||
|
||||
public function scoreBizDay($day)
|
||||
{
|
||||
$getPage = $this->input->get('biz_page');
|
||||
!$day && $day = date('Y-m-d', strtotime("-1 day"));
|
||||
$receiverScoreDayModel = new Receiver_score_day_model();
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_DAY_BIZ_PLAN_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 50;
|
||||
$where = [
|
||||
'day' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$rows = $receiverScoreDayModel->select($where, "id desc", $page, $size, 'DISTINCT biz_id,day');
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ
|
||||
];
|
||||
$scoreDayRow = $receiverScoreDayModel->get($where);
|
||||
$total_num = $receiverScoreDayModel->count(['biz_id' => $item['biz_id'], 'day' => $day]);
|
||||
$scoreSum = $receiverScoreDayModel->sum('score', ['biz_id' => $item['biz_id'], 'day' => $day]);
|
||||
$total_score = $scoreSum ? $scoreSum['score'] : 0;
|
||||
$score = $total_num > 0 ? $total_score / $total_num : 0;
|
||||
//获取上一天数据
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day<' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ
|
||||
];
|
||||
$dayRow = $receiverScoreDayModel->select($where, 'day desc', 1, 1, 'score');
|
||||
$change_score = $dayRow[0]['score'] ? $score - $dayRow[0]['score'] : $score;
|
||||
if ($scoreDayRow) {
|
||||
$receiverScoreDayModel->update([
|
||||
'score' => $score, 'total_score' => $total_score,
|
||||
'total_num' => $total_num, 'change_score' => $change_score
|
||||
], ['id' => $scoreDayRow['id']]);
|
||||
} else {
|
||||
$biz = $this->biz_model->get(['id' => $item['biz_id']]);
|
||||
$addData = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'day' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ,
|
||||
'change_score' => $change_score, 'c_time' => time(),
|
||||
'province_id' => $biz['province_id'] ?: 0,
|
||||
];
|
||||
$receiverScoreDayModel->add($addData);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '店铺合并统计数据执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
|
||||
public function mergeUser()
|
||||
{
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$m = date('d');
|
||||
if (!$t_limit && $m != 1) { //每月1号执行
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$getPage = $this->input->get('page');
|
||||
$year = date('Y', strtotime('last month'));
|
||||
$month = date('m', strtotime('last month'));
|
||||
$firstDayOfLastMonth = date('Y-m-01', strtotime('last month'));
|
||||
$lastDayOfLastMonth = date('Y-m-t', strtotime('last month'));
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_MONTH_PLAN_USER_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 50;
|
||||
$receiverScoreDayModel = new Receiver_score_day_model();
|
||||
$receiverScoreMonthModel = new Receiver_score_month_model();
|
||||
$where = [
|
||||
'type' => $receiverScoreDayModel::TYPE_USER,
|
||||
'day>=' => $firstDayOfLastMonth,
|
||||
'day<=' => $lastDayOfLastMonth,
|
||||
];
|
||||
$rows = $receiverScoreDayModel->select($where, '', $page, $size, 'DISTINCT biz_id,uid,province_id');
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$total_sum = $receiverScoreDayModel->sum('score', [
|
||||
'type' => $receiverScoreDayModel::TYPE_USER,
|
||||
'uid' => $item['uid'],
|
||||
'day>=' => $firstDayOfLastMonth,
|
||||
'day<=' => $lastDayOfLastMonth,
|
||||
]);
|
||||
$total_score = $total_sum['score'] ? $total_sum['score'] : 0;
|
||||
$total_num = $receiverScoreDayModel->count([
|
||||
'type' => $receiverScoreDayModel::TYPE_USER,
|
||||
'uid' => $item['uid'],
|
||||
'day>=' => $firstDayOfLastMonth,
|
||||
'day<=' => $lastDayOfLastMonth,
|
||||
]);
|
||||
$score = $total_num > 0 ? $total_score / $total_num : 0;
|
||||
$where = [
|
||||
'uid' => $item['uid'],
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$monthRow = $receiverScoreMonthModel->get($where);
|
||||
//获取上一个月数据
|
||||
$where = [
|
||||
'uid' => $item['uid'],
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$monthRow && $where['id<'] = $monthRow['id'];
|
||||
$lastRow = $receiverScoreMonthModel->select($where, 'c_time desc', 1, 1, 'score');
|
||||
$change_score = $lastRow[0]['score'] ? $score - $lastRow[0]['score'] : $score;
|
||||
if ($monthRow) {
|
||||
$update = [
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
];
|
||||
$receiverScoreMonthModel->update($update, ['id' => $monthRow['id']]);
|
||||
} else {
|
||||
$add = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'uid' => $item['uid'],
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'type' => Receiver_score_month_model::TYPE_USER,
|
||||
'province_id' => $item['province_id'],
|
||||
'c_time' => time(),
|
||||
];
|
||||
$receiverScoreMonthModel->add($add);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
|
||||
public function mergeBiz()
|
||||
{
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$m = date('d');
|
||||
if (!$t_limit && $m != 1) { //每月1号执行
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$getPage = $this->input->get('page');
|
||||
$year = date('Y', strtotime('last month'));
|
||||
$month = date('m', strtotime('last month'));
|
||||
$firstDayOfLastMonth = date('Y-m-01', strtotime('last month'));
|
||||
$lastDayOfLastMonth = date('Y-m-t', strtotime('last month'));
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_MONTH_PLAN_BIZ_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 50;
|
||||
$receiverScoreDayModel = new Receiver_score_day_model();
|
||||
$receiverScoreMonthModel = new Receiver_score_month_model();
|
||||
$where = [
|
||||
'type' => $receiverScoreDayModel::TYPE_BIZ,
|
||||
'day>=' => $firstDayOfLastMonth,
|
||||
'day<=' => $lastDayOfLastMonth,
|
||||
];
|
||||
$rows = $receiverScoreDayModel->select($where, '', $page, $size, 'DISTINCT biz_id,province_id');
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$total_sum = $receiverScoreDayModel->sum('score', [
|
||||
'type' => $receiverScoreDayModel::TYPE_BIZ,
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day>=' => $firstDayOfLastMonth,
|
||||
'day<=' => $lastDayOfLastMonth,
|
||||
]);
|
||||
$total_score = $total_sum['score'] ? $total_sum['score'] : 0;
|
||||
$total_num = $receiverScoreDayModel->count([
|
||||
'type' => $receiverScoreDayModel::TYPE_BIZ,
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day>=' => $firstDayOfLastMonth,
|
||||
'day<=' => $lastDayOfLastMonth,
|
||||
]);
|
||||
$score = $total_num > 0 ? $total_score / $total_num : 0;
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ
|
||||
];
|
||||
$monthRow = $receiverScoreMonthModel->get($where);
|
||||
//获取上一个月数据
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ
|
||||
];
|
||||
$monthRow && $where['id<'] = $monthRow['id'];
|
||||
$lastRow = $receiverScoreMonthModel->select($where, 'c_time desc', 1, 1, 'score');
|
||||
$change_score = $lastRow[0]['score'] ? $score - $lastRow[0]['score'] : $score;
|
||||
if ($monthRow) {
|
||||
$update = [
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
];
|
||||
$receiverScoreMonthModel->update($update, ['id' => $monthRow['id']]);
|
||||
} else {
|
||||
$add = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'type' => Receiver_score_month_model::TYPE_BIZ,
|
||||
'province_id' => $item['province_id'],
|
||||
'c_time' => time(),
|
||||
];
|
||||
$receiverScoreMonthModel->add($add);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
|
||||
public function mergeAvgUser()
|
||||
{
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$h = date('H');
|
||||
if (!$t_limit && $h > 5) {
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$getPage = $this->input->get('page');
|
||||
$s_time = date('Y-m-01');
|
||||
$e_time = date('Y-m-t');
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_AGV_PLAN_USER_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 50;
|
||||
$receiverScoreDayModel = new Receiver_score_day_model();
|
||||
$receiverScoreAvgDayModel = new Receiver_score_avg_day_model();
|
||||
$where = [
|
||||
'type' => $receiverScoreDayModel::TYPE_USER,
|
||||
'day>=' => $s_time,
|
||||
'day<=' => $e_time,
|
||||
];
|
||||
$rows = $receiverScoreDayModel->select($where, '', $page, $size, 'DISTINCT biz_id,uid,province_id');
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$total_sum = $receiverScoreDayModel->sum('score', [
|
||||
'type' => $receiverScoreDayModel::TYPE_USER,
|
||||
'uid' => $item['uid'],
|
||||
'day>=' => $s_time,
|
||||
'day<=' => $e_time,
|
||||
]);
|
||||
$total_score = $total_sum['score'] ? $total_sum['score'] : 0;
|
||||
$total_num = $receiverScoreDayModel->count([
|
||||
'type' => $receiverScoreDayModel::TYPE_USER,
|
||||
'uid' => $item['uid'],
|
||||
'day>=' => $s_time,
|
||||
'day<=' => $e_time,
|
||||
]);
|
||||
$score = $total_num > 0 ? $total_score / $total_num : 0;
|
||||
$where = [
|
||||
'uid' => $item['uid'],
|
||||
'day' => date('Y-m-d'),
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$monthRow = $receiverScoreAvgDayModel->get($where);
|
||||
//获取最后一条数据
|
||||
$where = [
|
||||
'uid' => $item['uid'],
|
||||
'type' => Receiver_score_day_model::TYPE_USER
|
||||
];
|
||||
$monthRow && $where['id<'] = $monthRow['id'];
|
||||
$lastRow = $receiverScoreAvgDayModel->select($where, 'c_time desc', 1, 1, 'score');
|
||||
$change_score = $lastRow[0]['score'] ? $score - $lastRow[0]['score'] : $score;
|
||||
if ($monthRow) {
|
||||
$update = [
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
];
|
||||
$receiverScoreAvgDayModel->update($update, ['id' => $monthRow['id']]);
|
||||
} else {
|
||||
$add = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'uid' => $item['uid'],
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
'day' => date('Y-m-d'),
|
||||
'type' => Receiver_score_month_model::TYPE_USER,
|
||||
'province_id' => $item['province_id'],
|
||||
'c_time' => time(),
|
||||
];
|
||||
$receiverScoreAvgDayModel->add($add);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
|
||||
public function mergeAvgBiz()
|
||||
{
|
||||
$t_limit = $this->input->get('time_limit');
|
||||
$h = date('H');
|
||||
if (!$t_limit && $h > 5) {
|
||||
echo '当前时间段不可执行';
|
||||
exit;
|
||||
}
|
||||
$getPage = $this->input->get('page');
|
||||
$s_time = date('Y-m-01');
|
||||
$e_time = date('Y-m-t');
|
||||
$redis = &load_cache('redis');
|
||||
$pageCacheKey = "RECEIVER_SCORE_AGV_PLAN_BIZ_PAGE";
|
||||
if ($getPage) {
|
||||
$page = $getPage;
|
||||
} else {
|
||||
$page = $redis->get($pageCacheKey) ?: 1;
|
||||
}
|
||||
$size = 50;
|
||||
$receiverScoreDayModel = new Receiver_score_day_model();
|
||||
$receiverScoreAvgDayModel = new Receiver_score_avg_day_model();
|
||||
$where = [
|
||||
'type' => $receiverScoreDayModel::TYPE_BIZ,
|
||||
'day>=' => $s_time,
|
||||
'day<=' => $e_time,
|
||||
];
|
||||
$rows = $receiverScoreDayModel->select($where, '', $page, $size, 'DISTINCT biz_id,province_id');
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$total_sum = $receiverScoreDayModel->sum('score', [
|
||||
'type' => $receiverScoreDayModel::TYPE_BIZ,
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day>=' => $s_time,
|
||||
'day<=' => $e_time,
|
||||
]);
|
||||
$total_score = $total_sum['score'] ? $total_sum['score'] : 0;
|
||||
$total_num = $receiverScoreDayModel->count([
|
||||
'type' => $receiverScoreDayModel::TYPE_BIZ,
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day>=' => $s_time,
|
||||
'day<=' => $e_time,
|
||||
]);
|
||||
$score = $total_num > 0 ? $total_score / $total_num : 0;
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'day' => date('Y-m-d'),
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ
|
||||
];
|
||||
$monthRow = $receiverScoreAvgDayModel->get($where);
|
||||
//获取上一个月数据
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'type' => Receiver_score_day_model::TYPE_BIZ
|
||||
];
|
||||
$monthRow && $where['id<'] = $monthRow['id'];
|
||||
$lastRow = $receiverScoreAvgDayModel->select($where, 'c_time desc', 1, 1, 'score');
|
||||
$change_score = $lastRow[0]['score'] ? $score - $lastRow[0]['score'] : $score;
|
||||
if ($monthRow) {
|
||||
$update = [
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
];
|
||||
$receiverScoreAvgDayModel->update($update, ['id' => $monthRow['id']]);
|
||||
} else {
|
||||
$add = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'score' => $score,
|
||||
'total_score' => $total_score,
|
||||
'total_num' => $total_num,
|
||||
'change_score' => $change_score,
|
||||
'day' => date('Y-m-d'),
|
||||
'type' => Receiver_score_month_model::TYPE_BIZ,
|
||||
'province_id' => $item['province_id'],
|
||||
'c_time' => time(),
|
||||
];
|
||||
$receiverScoreAvgDayModel->add($add);
|
||||
}
|
||||
}
|
||||
debug_log("[info]# 当前执行页数" . $page, __FUNCTION__, $this->log_dir);
|
||||
$page++;
|
||||
$redis->save($pageCacheKey, $page, 60 * 60);
|
||||
} else {
|
||||
$msg = '执行完成';
|
||||
echo $msg;
|
||||
debug_log("[info]# " . $msg, __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Vim
|
||||
* User: lcc
|
||||
* Desc: 晓致拨号回调
|
||||
* Date: 2021/4/14
|
||||
* Time: 19:15
|
||||
*/
|
||||
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
|
||||
|
||||
class Xzcall extends HD_Controller
|
||||
{
|
||||
|
||||
private $log_file;
|
||||
private $admin_config = [
|
||||
'app_id' => 1206,
|
||||
'app_key' => 'WX6HDVZX3AYSZDR1739332ZM'
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->log_file = 'call_xz.log';
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'mdOplogs');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
debug_log("start function:" . __FUNCTION__, $this->log_file);
|
||||
$data = $this->input->post();
|
||||
debug_log('data:' . json_encode($data, JSON_UNESCAPED_UNICODE), $this->log_file);
|
||||
if ($data && $data['seqId']) {
|
||||
$row = $this->receiver_xz_model->get(array('call_id' => $data['seqId']));
|
||||
if ($row) {
|
||||
$jsondata = json_decode($row['json_data'], true);
|
||||
$data['uname'] = $jsondata['uname'];
|
||||
$data['brand_id'] = $jsondata['brand_id'];
|
||||
$up_data['caller_state'] = $data['status'];
|
||||
$up_data['status'] = 1;
|
||||
$data['mid'] && $up_data['mid'] = $data['mid'];
|
||||
$data['to'] && $up_data['called_num'] = $data['to'];
|
||||
$data['from'] && $up_data['caller_num'] = $data['from'];
|
||||
if ($data['callAnswer']) {
|
||||
$up_data['duration'] = $data['callEnd'] - $data['callAnswer'];
|
||||
$up_data['answer_time'] = $this->getMsecToMescdate($data['callAnswer']);
|
||||
}
|
||||
$data['callStart'] && $up_data['start_time'] = $this->getMsecToMescdate($data['callStart']);
|
||||
$data['callEnd'] && $up_data['end_time'] = $this->getMsecToMescdate($data['callEnd']);
|
||||
$up_data['json_data'] = json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
$this->receiver_xz_model->update($up_data, ['id' => $row['id']]);
|
||||
if ($row['cf_id'] && $row['cf_platform'] == 'admin') { //后台
|
||||
$admin_id = $row['cf_uid'];
|
||||
$this->load->model('sys/sys_admin_model');
|
||||
$admin = $this->sys_admin_model->get(array('id' => $admin_id));
|
||||
$addData = array(
|
||||
'uid' => $admin_id,
|
||||
'uname' => $admin['username'] ? $admin['username'] : '',
|
||||
'type' => 2,//类型 0 普通 1短信 2电话
|
||||
'log' => $row['id'],
|
||||
'c_time' => time()
|
||||
);
|
||||
if ($row['cf_title'] == 'clues') {//线索拨打电话回调
|
||||
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
|
||||
$addData['clue_id'] = $row['cf_id'];
|
||||
} else if ($row['cf_title'] == 'customer') {//客户拨打电话回调
|
||||
$addData['customer_id'] = $row['cf_id'];
|
||||
$addData['sub_type'] = Receiver_customer_oplogs_model::SUB_TYPE_XZ;
|
||||
} else if ($row['cf_title'] == 'owners') {//车主拨打电话回调
|
||||
$this->load->model('receiver/receiver_owners_oplogs_model', 'mdOplogs');
|
||||
$addData['own_id'] = $row['cf_id'];
|
||||
}
|
||||
$this->mdOplogs->add($addData);
|
||||
$xcall = new Xcall($this->admin_config);
|
||||
//解绑
|
||||
$xcall->SWunbind($data['to'], $data['virtualMobile']);
|
||||
} elseif ($row['cf_id'] && $row['cf_platform'] == 'api') { //狸车宝
|
||||
$this->config->load('xcall');
|
||||
$params = [
|
||||
'app_id' => $this->config->item('app_id'),
|
||||
'app_key' => $this->config->item('app_key'),
|
||||
];
|
||||
$xcall = new Xcall($params);
|
||||
//解绑
|
||||
$result = $xcall->AXBUnbind($data['to'], $data['from'], $data['virtualMobile']);
|
||||
//删除redis
|
||||
$cache_key = "XZ_LICHEB_MOBILEA_{$data['from']}_MOBILEB_{$data['to']}_{$row['cf_uid']}";
|
||||
$redis = &load_cache('redis');
|
||||
$redis->delete($cache_key);
|
||||
$cust = $this->customers_model->get(['id' => $row['cf_id']]);
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$visit = $row['cf_title'] == 'customer' ? 1 : 0;
|
||||
$this->customers_entity->add_log_visit($cust['id'], $row['cf_uid'], $data['uname'], $row['id'], 2, $visit, [], 'wxapp', Receiver_customer_oplogs_model::SUB_TYPE_XZ);
|
||||
}
|
||||
} else {
|
||||
// if ($data['virtualMobile'] == '13391247942') { //推送test环境
|
||||
// $url = "https://api.lc.haodian.cn/plan/xzcall";
|
||||
// $this->load->library('mycurl');
|
||||
// $res = $this->mycurl->httpPost($url, $data);
|
||||
// debug_log('结束,推送test环境:' . json_encode($res, JSON_UNESCAPED_UNICODE), $this->log_file);
|
||||
// }
|
||||
debug_log("error: 未找到拨打记录", $this->log_file);
|
||||
}
|
||||
}
|
||||
debug_log("end " . __FUNCTION__, $this->log_file);
|
||||
echo '{"result":"0","error":""}';
|
||||
}
|
||||
|
||||
//录音推送地址
|
||||
public function video()
|
||||
{
|
||||
$data = $this->input->post();
|
||||
debug_log("start function:" . __FUNCTION__, $this->log_file);
|
||||
debug_log('data:' . json_encode($data, JSON_UNESCAPED_UNICODE), $this->log_file);
|
||||
$row = $this->receiver_xz_model->get(array('mid' => $data['mid']));
|
||||
if ($row) {
|
||||
$jsondata = json_decode($row['json_data'], true);
|
||||
if ($data['getFileUrl']) {
|
||||
if ($data['id'] == $this->admin_config['app_id']) {
|
||||
$params = $this->admin_config;
|
||||
} else {
|
||||
$this->config->load('xcall');
|
||||
$params = [
|
||||
'app_id' => $this->config->item('app_id'),
|
||||
'app_key' => $this->config->item('app_key'),
|
||||
];
|
||||
}
|
||||
$xcall = new Xcall($params);
|
||||
$result = $xcall->getFile($data['getFileUrl'], $data['mid'], $data['tag']);
|
||||
if ($result['code']) { //上传七牛
|
||||
$this->load->library('qiniu');
|
||||
$qiniu = new Qiniu(['type' => 'video']);
|
||||
$filename = $qiniu->getFileName($data['mid'], 'mp3', 'xz_video_');
|
||||
$q_res = $qiniu->save($filename, $result['data']);
|
||||
if (!$q_res) {
|
||||
debug_log('error:文件上传七牛失败', $this->log_file);
|
||||
} else {
|
||||
$up_data['rec_url'] = $q_res['url'];
|
||||
}
|
||||
} else {
|
||||
debug_log('error:' . json_encode($result, JSON_UNESCAPED_UNICODE), $this->log_file);
|
||||
}
|
||||
}
|
||||
$jsondata['file_info'] = $data;
|
||||
$up_data['json_data'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$this->receiver_xz_model->update($up_data, ['id' => $row['id']]);
|
||||
} else {
|
||||
//推送test环境
|
||||
// $url = "https://api.ss.haodian.cn/plan/xzcall/video";
|
||||
// $this->load->library('mycurl');
|
||||
// $res = $this->mycurl->httpPost($url, $data);
|
||||
// debug_log('结束,推送test环境:' . json_encode($res, JSON_UNESCAPED_UNICODE), $this->log_file);
|
||||
}
|
||||
debug_log("end " . __FUNCTION__, $this->log_file);
|
||||
echo '{"result":"0","error":""}';
|
||||
}
|
||||
|
||||
/**
|
||||
* 毫秒转日期
|
||||
*/
|
||||
private function getMsecToMescdate($msectime)
|
||||
{
|
||||
$msectime = $msectime * 0.001;
|
||||
if (strstr($msectime, '.')) {
|
||||
sprintf("%01.3f", $msectime);
|
||||
list($usec, $sec) = explode(".", $msectime);
|
||||
$sec = str_pad($sec, 3, "0", STR_PAD_RIGHT);
|
||||
} else {
|
||||
$usec = $msectime;
|
||||
$sec = "000";
|
||||
}
|
||||
$date = date("Y-m-d H:i:s.x", $usec);
|
||||
return $mescdate = str_replace('x', $sec, $date);
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,6 @@ class Yxcall extends HD_Controller
|
||||
} else if ($row['cf_title'] == 'customer') {//客户拨打电话回调
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'mdOplogs');
|
||||
$addData['customer_id'] = $row['cf_id'];
|
||||
$addData['cf_platform'] = $row['admin'];
|
||||
}
|
||||
$this->mdOplogs->add($addData);
|
||||
$ycall = new Ycall();
|
||||
@@ -69,7 +68,7 @@ class Yxcall extends HD_Controller
|
||||
$result = $ycall->AXBUnbind($data['displayNumber'], $data['calleeNumber'], $data['callerNumber']);
|
||||
//删除redis
|
||||
$cache_key = "XZ_LICHEB_MOBILEA_{$data['calleeNumber']}_MOBILEB_{$data['callerNumber']}_{$row['cf_uid']}";
|
||||
$redis = &load_cache();
|
||||
$redis = &load_cache('redis');
|
||||
$redis->delete($cache_key);
|
||||
$cust = $this->customers_model->get(['id' => $row['cf_id']]);
|
||||
$visit = $row['cf_title'] == 'customer' ? 1 : 0;
|
||||
|
||||
@@ -20,11 +20,11 @@ abstract class Wxapp extends HD_Controller
|
||||
protected $log_dir;//日志目录
|
||||
protected $session;//登录状态密钥
|
||||
|
||||
protected $login_white=[];//登录白名单每个ct单独管控
|
||||
protected $login_white;//登录白名单每个ct单独管控
|
||||
protected $majia_white;//超级管理员披上马甲可操作权限
|
||||
protected $check_status = [];//需校验用户正常请求列表,每个ct单独管控
|
||||
protected $check_mobile = [];//需要校验手机号,每个ct单独管控
|
||||
protected $check_headimg = [];//校验使用授权用户头像
|
||||
protected $check_status;//需校验用户正常请求列表,每个ct单独管控
|
||||
protected $check_mobile;//需要校验手机号,每个ct单独管控
|
||||
protected $check_headimg;//校验使用授权用户头像
|
||||
|
||||
protected $wx_config;//微信配置
|
||||
protected $cf_title;
|
||||
@@ -101,8 +101,6 @@ abstract class Wxapp extends HD_Controller
|
||||
|
||||
//获取session
|
||||
$this->fetch_session();
|
||||
//请求接口就算开工-增加基础分(一天只能算一次)
|
||||
// $this->add_user_score();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -539,24 +537,4 @@ abstract class Wxapp extends HD_Controller
|
||||
{
|
||||
return $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
|
||||
}
|
||||
|
||||
//添加积分
|
||||
protected function add_user_score()
|
||||
{
|
||||
$redis = &load_cache('redis');
|
||||
$cache_key = "RECEIVER_SCORE_LOG_API_{$this->session['uid']}";
|
||||
if ($redis->get($cache_key)) {
|
||||
return false;
|
||||
}
|
||||
if (in_array($this->session['group_id'], [App_licheb_users_model::GROUP_BIZ, App_licheb_users_model::GROUP_MANAGER])) {
|
||||
$redis->save($cache_key, 1, 60 * 60);
|
||||
$this->load->model('receiver/receiver_score_log_model');
|
||||
$this->load->model('receiver/receiver_score_config_model');
|
||||
$scoreLogModel = new receiver_score_log_model();
|
||||
$day = date('Y-m-d');
|
||||
$scoreLogModel->add_score($this->session['uid'], $this->get_biz_id(), $day, Receiver_score_config_model::TYPE_BASE,
|
||||
Receiver_score_config_model::TYPE_BASE_KG, '开工', 1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
|
||||
class City extends Wxapp
|
||||
{
|
||||
private $province_lists = [350000, 430000]; //开放省份 湖南 福建
|
||||
private $province_lists = [430000, 350000]; //开放省份 湖南 福建
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
@@ -47,7 +47,9 @@ class City extends Wxapp
|
||||
$biz_ids = implode(',', $biz_id_arr);
|
||||
$biz_where["id in ({$biz_ids})"] = null;
|
||||
}
|
||||
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',', array_keys($typeAry));
|
||||
$type_ids && $biz_where["type in ($type_ids)"] = null;
|
||||
$biz_rows = $this->biz_model->select_groupby('city_id', $biz_where, '', '', '', 'id,city_id');
|
||||
$city_ids = implode(',', array_column($biz_rows, 'city_id'));
|
||||
$city_ids && $where["city_id in ($city_ids)"] = null;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
defined('WXAPP_APP') or exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
|
||||
class Paic extends Wxapp
|
||||
{
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
parent::__construct($inputs, $app_key);
|
||||
|
||||
$this->login_white = array();//登录白名单
|
||||
$this->check_status = array();//用户状态校验
|
||||
$this->check_mobile = array();//需要手机号
|
||||
$this->check_headimg = array();//授权微信信息
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
|
||||
}
|
||||
|
||||
//获取车系
|
||||
protected function get()
|
||||
{
|
||||
$page = $this->input_param('page');
|
||||
$size = $this->input_param('size');
|
||||
$keyword = $this->input_param('keyword');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 100;
|
||||
|
||||
$where = [
|
||||
'status' => App_paic_users_model::STATUS_NORMAL
|
||||
];
|
||||
if ($keyword) {
|
||||
$where["name like '%{$keyword}%'"] = null;
|
||||
}
|
||||
$count = $this->app_paic_users_model->count($where);
|
||||
$list = $this->app_paic_users_model->select($where, 'id desc', $page, $size, 'id,name');
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'total' => $count
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
//defined('WXAPP_APP') OR exit('No direct script access allowed');
|
||||
defined('WXAPP_APP') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Created by Vim
|
||||
@@ -29,7 +29,7 @@ class Series extends Wxapp{
|
||||
$size = $this->input_param('size');
|
||||
$brand_id = $this->input_param('brand_id');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 100;
|
||||
!$size && $size = 20;
|
||||
|
||||
$where = [
|
||||
'status' => 1
|
||||
@@ -55,7 +55,7 @@ class Series extends Wxapp{
|
||||
'status' => 1
|
||||
];
|
||||
$count = $this->auto_brand_model->count($where);
|
||||
$list = $this->auto_brand_model->select($where,'initial asc',$page,$size,'id,name');
|
||||
$list = $this->auto_brand_model->select($where,'id desc',$page,$size,'id,name');
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'total' => $count
|
||||
@@ -63,22 +63,6 @@ class Series extends Wxapp{
|
||||
return $data;
|
||||
}
|
||||
|
||||
//获取品牌
|
||||
protected function get_mbrand(){
|
||||
$keyword = $this->input_param('keyword');
|
||||
$where = ['status' => 1];
|
||||
$keyword && $where["name like '%{$keyword}%'"] = null;
|
||||
|
||||
$count = $this->auto_brand_model->count($where);
|
||||
$list = $this->auto_brand_model->select($where,'initial asc', 0, 0, 'id,name');
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'total' => $count
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
//获取车型列表
|
||||
protected function get_cars(){
|
||||
$page = $this->input_param('page');
|
||||
|
||||
@@ -27,13 +27,11 @@ class Cusorder extends Wxapp
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_cars_model');
|
||||
|
||||
$this->load->model('app/licheb/app_licheb_users_model', 'app_user_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$this->load->library('receiver/orders_entity');
|
||||
$this->load->library('receiver/order_datas_entity');
|
||||
|
||||
$this->biz_id = $this->get_biz_id();
|
||||
}
|
||||
|
||||
@@ -62,7 +60,6 @@ class Cusorder extends Wxapp
|
||||
$if_num = $this->input_param('if_num');
|
||||
$if_insure = $this->input_param('if_insure');
|
||||
$register_amount = $this->input_param('register_amount'); //上牌费
|
||||
$if_equity = $this->input_param('if_equity');
|
||||
//贷款相关参数
|
||||
$downpayment_type = $this->input_param('downpayment_type');
|
||||
$loan_amount = $this->input_param('loan_amount');
|
||||
@@ -100,7 +97,6 @@ class Cusorder extends Wxapp
|
||||
$in_color && $data['in_color'] = $in_color;
|
||||
$if_num && $data['if_num'] = 1;
|
||||
$if_insure && $data['if_insure'] = 1;
|
||||
$if_equity && $data['if_equity'] = 1;
|
||||
$money_json = [];
|
||||
$money_json['confirm_amount'] = $confirm_amount ? $confirm_amount : 0;
|
||||
$money_json['discount_amount'] = $discount_amount ? $discount_amount : 0;
|
||||
@@ -114,22 +110,11 @@ class Cusorder extends Wxapp
|
||||
$money_json['register_amount'] = $register_amount ? $register_amount : 0;
|
||||
}
|
||||
$data['money_json'] = json_encode($money_json, JSON_UNESCAPED_UNICODE);
|
||||
$data['cps_type'] = $this->orders_model->get_cps_type($data['brand_id']);
|
||||
$o_id = $this->orders_model->add($data);
|
||||
if (is_numeric($o_id)) {
|
||||
//更新客户
|
||||
$this->customers_model->update(['status' => 2, 'order_time' => date('Y-m-d H:i:s')], ['id' => $cus_id]);
|
||||
$this->customers_entity->add_log($cus_id, $this->session['uid'], $this->session['uname'], '生成订单', 6);
|
||||
|
||||
//发短信
|
||||
$users = $this->app_user_model->select(array('group_id' => 4, 'biz_id like "%,'.$this->biz_id.',%"' => null));
|
||||
if($users){
|
||||
foreach ($users as $v){
|
||||
$content = "【理车宝】亲爱的客户成功经理,您管理的".$biz['biz_name'].'新增了一个订单。';
|
||||
b2m_send_sms($v['mobile'], $content);
|
||||
}
|
||||
}
|
||||
|
||||
return ['id' => $o_id];
|
||||
} else {
|
||||
throw new Exception('创建失败', ERR_PARAMS_ERROR);
|
||||
@@ -146,7 +131,6 @@ class Cusorder extends Wxapp
|
||||
$delry_time = $this->input_param('delry_time');
|
||||
$if_num = $this->input_param('if_num');
|
||||
$if_insure = $this->input_param('if_insure');
|
||||
$if_equity = $this->input_param('if_equity');
|
||||
$register_amount = $this->input_param('register_amount'); //上牌费
|
||||
//贷款相关参数
|
||||
$downpayment_type = $this->input_param('downpayment_type');
|
||||
@@ -172,7 +156,6 @@ class Cusorder extends Wxapp
|
||||
$in_color && $data['in_color'] = $in_color;
|
||||
$data['if_num'] = $if_num ? 1 : 0;
|
||||
$data['if_insure'] = $if_insure ? 1 : 0;
|
||||
$data['if_equity'] = $if_equity ? 1 : 0;
|
||||
$money_json = json_decode($row['money_json'], true);
|
||||
$money_json['confirm_amount'] = $confirm_amount ? $confirm_amount : 0;
|
||||
$money_json['discount_amount'] = $discount_amount ? $discount_amount : 0;
|
||||
@@ -230,18 +213,14 @@ class Cusorder extends Wxapp
|
||||
if (!$data_row['cardida'] && !$row['main_type']) throw new Exception('身份证未上传', ERR_PARAMS_ERROR);
|
||||
if (!$data_row['bill_img'] && $row['main_type']) throw new Exception('营业执照未上传', ERR_PARAMS_ERROR);
|
||||
if (!$data_row['pay_img']) throw new Exception('付款凭证未上传', ERR_PARAMS_ERROR);
|
||||
//if (!$data_row['equity_ck_img']) throw new Exception('权益书未上传', ERR_PARAMS_ERROR);
|
||||
if (!$data_row['equity_ck_img']) throw new Exception('权益书未上传', ERR_PARAMS_ERROR);
|
||||
} elseif ($status == 2) { //开票信息确认无误:判断 发票 必须上传
|
||||
if (!$data_row['bill_img']) throw new Exception('发票未上传', ERR_PARAMS_ERROR);
|
||||
} elseif ($status == 3) {//车辆交付信息: 判断 行驶证、保单 必须上传
|
||||
if (!$data_row['car_img']) throw new Exception('行驶证未上传', ERR_PARAMS_ERROR);
|
||||
if (!$data_row['insurance_img']) throw new Exception('保单未上传', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$update = ['status' => $status];
|
||||
if($status==3){
|
||||
$update['over_time'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
$res = $this->orders_model->update($update, ['id' => $id]);
|
||||
$res = $this->orders_model->update(['status' => $status], ['id' => $id]);
|
||||
if ($res) {
|
||||
if($status == -1){
|
||||
throw new Exception('操作成功', API_CODE_SUCCESS);
|
||||
@@ -272,10 +251,10 @@ class Cusorder extends Wxapp
|
||||
$this->receiver_order_oplogs_model->add($log);
|
||||
|
||||
//数据提交汽车之家
|
||||
// $res = $this->orders_entity->post_auto($id);
|
||||
// if (!$res['code']) {
|
||||
// throw new Exception('网络错误,请联系管理员', ERR_PARAMS_ERROR);
|
||||
// }
|
||||
$res = $this->orders_entity->post_auto($id);
|
||||
if (!$res['code']) {
|
||||
throw new Exception('网络错误,请联系管理员', ERR_PARAMS_ERROR);
|
||||
}
|
||||
throw new Exception('审核通过,操作成功', API_CODE_SUCCESS);
|
||||
} else {
|
||||
throw new Exception('操作失败,请联系管理员', ERR_PARAMS_ERROR);
|
||||
@@ -389,7 +368,7 @@ class Cusorder extends Wxapp
|
||||
}
|
||||
$admin_ids && $where["admin_id in ({$admin_ids})"] = null;
|
||||
$brand_id && $where['brand_id'] = $brand_id;
|
||||
$s_id && $where['series_id'] = $s_id;
|
||||
$s_id && $where['s_id'] = $s_id;
|
||||
$v_id && $where['v_id'] = $v_id;
|
||||
if ($group_id == 1) {
|
||||
$where['admin_id'] = $uid;//销售
|
||||
@@ -476,7 +455,7 @@ class Cusorder extends Wxapp
|
||||
|
||||
$o_data_1['订单合同'] = ['type' => 'text', 'value' => $img_status['contract_img']['text'], 'bg_color' => $img_status['contract_img']['color']];
|
||||
$o_data_1['付款凭证'] = ['type' => 'text', 'value' => $img_status['pay_img']['text'], 'bg_color' => $img_status['pay_img']['color']];
|
||||
//$o_data_1['权益确认书'] = ['type' => 'text', 'value' => $img_status['equity_ck_img']['text'], 'bg_color' => $img_status['equity_ck_img']['color']];
|
||||
$o_data_1['权益确认书'] = ['type' => 'text', 'value' => $img_status['equity_ck_img']['text'], 'bg_color' => $img_status['equity_ck_img']['color']];
|
||||
$o_data_2 = [
|
||||
'发票' => ['type' => 'text', 'value' => $img_status['bill_img']['text'], 'bg_color' => $img_status['bill_img']['color']]
|
||||
];
|
||||
@@ -541,7 +520,6 @@ class Cusorder extends Wxapp
|
||||
if (!$payway) { // 分期
|
||||
$car_data['按揭信息'] = '';
|
||||
}
|
||||
$car_data['投保买贵必赔'] = $row['if_equity'] ? '是' : '否';
|
||||
$car_data['是否店内投保'] = $row['if_insure'] ? '是' : '否';
|
||||
$car_data['是否店内上牌'] = $row['if_num'] ? '是' : '否';
|
||||
if ($row['if_num']) {
|
||||
@@ -556,7 +534,6 @@ class Cusorder extends Wxapp
|
||||
'payway' => $row['brand_id'] ? $row['payway'] : '',
|
||||
'main_type' => intval($row['main_type']),
|
||||
'brand_id' => $row['brand_id'],
|
||||
'brand_name' => $brand['name'],
|
||||
'series_id' => $row['series_id'],
|
||||
'car_id' => $row['car_id'],
|
||||
'cus_id' => $row['customer_id'],
|
||||
@@ -567,7 +544,6 @@ class Cusorder extends Wxapp
|
||||
'car_data' => $car_data,
|
||||
'if_num' => $row['if_num'],
|
||||
'if_insure' => $row['if_insure'],
|
||||
'if_equity' => $row['if_equity'],
|
||||
'delry_time' => date('Y-m-d', strtotime($row['delry_time'])),
|
||||
'money_json' => json_decode($row['money_json'], true),
|
||||
'downpayment_type' => $row['downpayment_type'],
|
||||
|
||||
@@ -9,7 +9,6 @@ require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
|
||||
class Cusorderdata extends Wxapp
|
||||
{
|
||||
private $biz_id = '';
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
@@ -22,14 +21,9 @@ class Cusorderdata extends Wxapp
|
||||
|
||||
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
$this->load->model('receiver/order/receiver_order_datas_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model('app/licheb/app_licheb_users_model', 'app_user_model');
|
||||
$this->load->model('receiver/order/receiver_order_oplogs_model');
|
||||
|
||||
$this->load->library('receiver/order_datas_entity');
|
||||
$this->load->library('TcOrc');
|
||||
|
||||
$this->biz_id = $this->get_biz_id();
|
||||
}
|
||||
|
||||
protected function get()
|
||||
@@ -281,22 +275,6 @@ class Cusorderdata extends Wxapp
|
||||
}
|
||||
$res = $this->receiver_order_datas_model->update($update, ['o_id' => $id]);
|
||||
if ($res) {
|
||||
//跳过审核
|
||||
if($jsondata['bill_info'] && $row['status'] == 1){
|
||||
$this->orders_model->update(['status' => 2], ['id' => $id]);
|
||||
}
|
||||
|
||||
$log = array(
|
||||
'order_id' => $id,
|
||||
'uid' => $this->session['uid'],
|
||||
'uname' => $this->session['uname'],
|
||||
'type' => 1,
|
||||
'log' => $key ? $key : '',
|
||||
'cf_platform' => 'wxapp',
|
||||
'c_time' => time(),
|
||||
);
|
||||
$this->receiver_order_oplogs_model->add($log);
|
||||
|
||||
throw new Exception('修改成功', API_CODE_SUCCESS);
|
||||
} else {
|
||||
throw new Exception('修改失败', ERR_PARAMS_ERROR);
|
||||
|
||||
@@ -25,7 +25,6 @@ class Customerlogs extends Wxapp
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'customer_oplogs_model');
|
||||
$this->load->model('receiver/receiver_comments_model', 'mdComments');
|
||||
$this->load->model('receiver/receiver_yx_model');
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
}
|
||||
|
||||
protected function get()
|
||||
@@ -41,7 +40,7 @@ class Customerlogs extends Wxapp
|
||||
$count = $this->customer_oplogs_model->count($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$rows = $this->customer_oplogs_model->select($where, 'id desc', $page, $size, 'id,log,uname,type,c_time,imgs,sub_type');
|
||||
$rows = $this->customer_oplogs_model->select($where, 'id desc', $page, $size, 'id,log,uname,type,c_time,imgs');
|
||||
foreach ($rows as $key => $val) {
|
||||
$record = '';
|
||||
$second = 0;
|
||||
@@ -54,17 +53,11 @@ class Customerlogs extends Wxapp
|
||||
}
|
||||
}
|
||||
if ($val['type'] == 2) {
|
||||
$rec_row = $this->receiver_yx_model->get(['id' => $val['log']], 'rec_url,duration');
|
||||
$content = '拨打电话';
|
||||
if ($val['sub_type'] == Receiver_customer_oplogs_model::SUB_TYPE_XZ) {
|
||||
$rec_row = $this->receiver_xz_model->get(['id' => $val['log']], 'rec_url,duration');
|
||||
$rec_row['rec_url'] && $record = $rec_row['rec_url'];
|
||||
$rec_row['duration'] && $second = intval($rec_row['duration'] / 1000);
|
||||
} else {
|
||||
$rec_row = $this->receiver_yx_model->get(['id' => $val['log']], 'rec_url,duration');
|
||||
$rec_row['rec_url'] && $record = get_yx_video($rec_row['rec_url']);
|
||||
$rec_row['duration'] && $second = intval($rec_row['duration']);
|
||||
}
|
||||
!$rec_row['duration'] && $content .= '(未接通)';
|
||||
$rec_row['rec_url'] && $record = get_yx_video($rec_row['rec_url']);
|
||||
$rec_row['duration'] && $second = intval($rec_row['duration']);
|
||||
}
|
||||
$comments = [];
|
||||
$res = $this->mdComments->select(['pid' => $val['id'], 'status' => 1, 'type' => 0], 'id asc', 0, 0
|
||||
|
||||
@@ -32,7 +32,6 @@ class Customers extends Wxapp
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
$this->biz_id = $this->get_biz_id();
|
||||
}
|
||||
|
||||
@@ -59,18 +58,7 @@ class Customers extends Wxapp
|
||||
if ($this->get_biz('type') != 5) {
|
||||
$other_data['客户来源'] = $this->get_cfTitle($row);
|
||||
}
|
||||
$brand_name = '';
|
||||
if ($row['brand_id']) {
|
||||
$brand_row = $this->auto_brand_model->get(['id' => intval($row['brand_id'])]);
|
||||
$brand_name = $brand_row['name'] ? $brand_row['name'] : '';
|
||||
}
|
||||
if ($row['series_id']) {
|
||||
$series_row = $this->auto_series_model->get(['id' => intval($row['series_id'])]);
|
||||
$series_name = $series_row['name'] ? $series_row['name'] : '';
|
||||
$series_name && $brand_name .= '-' . $series_name;
|
||||
}
|
||||
$brand_name && $other_data['关注车型'] = $brand_name;
|
||||
$other_data['建档时间'] = date('Y-m-d', strtotime($row['p_time']));
|
||||
$other_data['建档时间'] = date('Y-m-d', $row['c_time']);
|
||||
$row['cont_time'] != '0000-00-00 00:00:00' && $other_data['最近联系'] = date('Y-m-d', strtotime($row['cont_time']));
|
||||
if ($this->session['group_id'] == 1) {
|
||||
$where_visit = ['c_id' => $id, 'biz_id' => $this->biz_id, 'sales_id' => $this->session['uid']];
|
||||
@@ -122,10 +110,7 @@ class Customers extends Wxapp
|
||||
$cfrom_rows = $this->clues_cfrom_model->get(array('id' => $row['of_id']));
|
||||
$cfrom_rows['type'] == 1 && $edit_status = true;
|
||||
}
|
||||
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']]);
|
||||
$of_title = $row['of_id'] ? $this->get_cfTitle($row) : '';
|
||||
$paic_user = '';
|
||||
$row['cf_pid'] && $paic_user = $this->app_paic_users_model->get(['id' => $row['cf_pid']]);
|
||||
$data['baseinfo'] = [
|
||||
'name' => ['value' => $row['name'], 'cn' => '客户姓名'],
|
||||
'mobile' => ['value' => $this->get_mobile(['mobile' => $row['mobile'], 'rid' => $row['rid']]), 'cn' => '客户电话'],
|
||||
@@ -135,10 +120,6 @@ class Customers extends Wxapp
|
||||
'wxgr' => $row['wxgr'],
|
||||
'wxgrimg' => $row['wxgrimg'],
|
||||
'wxgrimg_url' => $row['wxgrimg'] ? build_qiniu_image_url($row['wxgrimg']) : '',
|
||||
'brand' => ['id' => $row['brand_id'], 'name' => $brand['name']],
|
||||
'series_id' => $row['series_id'],
|
||||
'cf_pid' => $row['cf_pid'],
|
||||
'cf_name' => $paic_user['name'] ?: '',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
@@ -229,9 +210,6 @@ class Customers extends Wxapp
|
||||
$county_id = $this->input_param('county_id'); //区id
|
||||
$wxgr = $this->input_param('wxgr'); //是否加个微
|
||||
$wxgrimg = $this->input_param('wxgrimg'); //个微截图
|
||||
$brand_id = (int)$this->input_param('brand_id');
|
||||
$series_id = (int)$this->input_param('series_id');
|
||||
$cf_pid = (int)$this->input_param('cf_pid');
|
||||
$row = $this->customers_model->get(['id' => $id]);
|
||||
if (!$row) {
|
||||
throw new Exception('参数错误', ERR_PARAMS_ERROR);
|
||||
@@ -260,13 +238,10 @@ class Customers extends Wxapp
|
||||
$county_id && $update['county_id'] = $county_id;
|
||||
$wxgr && $update['wxgr'] = intval($wxgr) ? 1 : 0;
|
||||
$wxgrimg && $wxgrimg != $row['wxgrimg'] && $update['wxgrimg'] = $wxgrimg;
|
||||
$brand_id && $update['brand_id'] = $brand_id ?: 0;
|
||||
$series_id && $update['series_id'] = $series_id ?: 0;
|
||||
if ($buy_time) {
|
||||
$update['level'] = $this->customers_entity->cal_level($buy_time);
|
||||
$update['buy_time'] = $buy_time;
|
||||
}
|
||||
$update['cf_pid'] = $cf_pid ?: 0;
|
||||
$update && $this->customers_model->update($update, ['id' => $id]);
|
||||
//客户标签
|
||||
if ($tag) {
|
||||
@@ -330,10 +305,6 @@ class Customers extends Wxapp
|
||||
$county_id = $this->input_param('county_id'); //区id
|
||||
$wxgr = $this->input_param('wxgr'); //是否加个微
|
||||
$wxgrimg = $this->input_param('wxgrimg'); //个微截图
|
||||
$brand_id = $this->input_param('brand_id');
|
||||
$series_id = $this->input_param('series_id');
|
||||
$car_id = $this->input_param('car_id');
|
||||
$cf_pid = $this->input_param('cf_pid');
|
||||
if (!mobile_valid($mobile)) throw new Exception('请输入正确的手机号码', ERR_PARAMS_ERROR);
|
||||
if (!$city_id || !$county_id) {
|
||||
throw new Exception('请选择城市与行政区', API_CODE_FAIL);
|
||||
@@ -356,9 +327,7 @@ class Customers extends Wxapp
|
||||
}
|
||||
return ['code' => API_CODE_FAIL, 'msg' => $msg, 'data' => ['id' => $is_exit['id'], 'owner' => $owner]];
|
||||
}
|
||||
if ($cf_row['id'] == 10) { //自然到店直接改成到店客户
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
$this->load->helper("order");
|
||||
$biz_row = $this->biz_model->get(['id' => $this->biz_id]);
|
||||
|
||||
@@ -381,15 +350,8 @@ class Customers extends Wxapp
|
||||
'county_id' => $county_id,
|
||||
'wxgr' => intval($wxgr) ? 1 : 0,
|
||||
'wxgrimg' => $wxgrimg ? $wxgrimg : '',
|
||||
'c_time' => time(),
|
||||
'sales_p_time' => $time,
|
||||
'c_time' => time()
|
||||
];
|
||||
if ($cf_row['id'] == 10) {
|
||||
$add_data['dt_time'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
if ($wxgr) {
|
||||
$add_data['add_wx_time'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
if (!$add_data['city_id'] && $biz_row['city_id']) {
|
||||
$add_data['city_id'] = $biz_row['city_id'];
|
||||
}
|
||||
@@ -399,9 +361,6 @@ class Customers extends Wxapp
|
||||
$buy_time && $add_data['buy_time'] = $buy_time;
|
||||
$of_id && $add_data['of_id'] = $of_id;
|
||||
$of2_id && $add_data['of2_id'] = $of2_id;
|
||||
$brand_id && $add_data['brand_id'] = $brand_id;
|
||||
$series_id && $add_data['series_id'] = $series_id;
|
||||
$cf_pid && $add_data['cf_pid'] = $cf_pid;
|
||||
$id = $this->customers_model->add($add_data);
|
||||
if ($id) {
|
||||
//客户标签
|
||||
@@ -574,7 +533,6 @@ class Customers extends Wxapp
|
||||
$jsondata['defeat']['time'] = date("Y-m-d H:i:s");
|
||||
$jsondata['defeat']['reason'] = $defeat_reason . "({$tag_str})";
|
||||
$up_data['if_defeat'] = 1;
|
||||
$up_data['apply_def_time'] = date("Y-m-d H:i:s");
|
||||
$up_data['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$log_0 = '申请战败:' . $defeat_reason . "({$tag_str})";
|
||||
} else {
|
||||
@@ -776,11 +734,6 @@ class Customers extends Wxapp
|
||||
'name' => $item['title'],
|
||||
];
|
||||
}
|
||||
|
||||
if ($this->biz_id == 10) {
|
||||
$lists[] = ['id' => 20, 'name' => '中台直播'];
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
@@ -799,7 +752,6 @@ class Customers extends Wxapp
|
||||
$if_driver = $this->input_param('if_driver');
|
||||
$level = $this->input_param('level');
|
||||
$brand_id = $this->input_param('brand_id');
|
||||
$series_id = $this->input_param('series_id');
|
||||
$cfrom = $this->input_param('cfrom'); //客户来源id
|
||||
$status = $this->input_param('status'); //状态
|
||||
$o_type = $this->input_param('o_type'); //排序
|
||||
@@ -887,7 +839,6 @@ class Customers extends Wxapp
|
||||
strlen($if_driver) && $where['if_driver'] = 1;
|
||||
strlen($status) && $where['status'] = $status;
|
||||
$brand_id && $where['brand_id'] = $brand_id;
|
||||
$series_id && $where['series_id'] = $series_id;
|
||||
$level && $where['level'] = $level;
|
||||
$cfrom && $where['cf_title'] = $cfrom;
|
||||
$name && $where["name like '%{$name}%'"] = null;
|
||||
@@ -929,8 +880,8 @@ class Customers extends Wxapp
|
||||
$count = $this->customers_model->count($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = 'id,rid,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,cont_time,c_time,p_time,if_defeat
|
||||
,of_id,of2_id,wxqy,status,biz_id,county_id,cid,brand_id,series_id';
|
||||
$fileds = 'id,rid,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,cont_time,c_time,if_defeat
|
||||
,of_id,of2_id,wxqy,status,biz_id,county_id,cid';
|
||||
$rows = $this->customers_model->select($where, $orderby, $page, $size, $fileds);
|
||||
$lists = $this->listCustomerField(['rows' => $rows, 'biz_type' => $biz_type, 'group_id' => $group_id]);
|
||||
}
|
||||
@@ -970,18 +921,7 @@ class Customers extends Wxapp
|
||||
if ($param['biz_type'] != 5) {
|
||||
$other_data['客户来源'] = $this->get_cfTitle($val);
|
||||
}
|
||||
$brand_name = '';
|
||||
if ($val['brand_id']) {
|
||||
$brand_row = $this->auto_brand_model->get(['id' => intval($val['brand_id'])]);
|
||||
$brand_name = $brand_row['name'] ? $brand_row['name'] : '';
|
||||
}
|
||||
if ($val['series_id']) {
|
||||
$series_row = $this->auto_series_model->get(['id' => intval($val['series_id'])]);
|
||||
$series_name = $series_row['name'] ? $series_row['name'] : '';
|
||||
$series_name && $brand_name .= '-' . $series_name;
|
||||
}
|
||||
$brand_name && $other_data['关注车型'] = $brand_name;
|
||||
$other_data['建档时间'] = date('Y-m-d', strtotime($val['p_time']));
|
||||
$other_data['建档时间'] = date('Y-m-d', $val['c_time']);
|
||||
$val['cont_time'] != '0000-00-00 00:00:00' && $other_data['最近联系'] = date('Y-m-d', strtotime($val['cont_time']));
|
||||
if ($param['group_id'] == 1) {
|
||||
$where_visit = ['c_id' => $val['id'], 'biz_id' => $this->biz_id, 'sales_id' => $this->session['uid']];
|
||||
@@ -1107,7 +1047,7 @@ class Customers extends Wxapp
|
||||
if ($re['admin_id'] == $admin_id) {//同个销售跳出循环
|
||||
continue;
|
||||
}
|
||||
$upDate = ['admin_id' => $admin_id, 'visit_time' => $visit_time, 'sales_p_time' => date('Y-m-d H:i:s')];
|
||||
$upDate = ['admin_id' => $admin_id, 'visit_time' => $visit_time];
|
||||
!$re['sales_id'] && $upDate['sales_id'] = $admin_id;//初始销售id
|
||||
$ret = $this->customers_model->update($upDate, ["id" => $id]);
|
||||
if ($ret) {
|
||||
@@ -1127,7 +1067,7 @@ class Customers extends Wxapp
|
||||
}
|
||||
//发送短信
|
||||
$num = $re['mobile'] ? substr($re['mobile'], -4) : 0;
|
||||
b2m_send_sms($admin['mobile'], '【理车宝】您有一个新的客户需要跟进,手机尾号为' . $num . '。请及时到小程序“理车宝-客户”进行操作,祝您成单!');
|
||||
b2m_send_sms($admin['mobile'], '【理车宝】您有一个新的客户需要跟进,手机尾号为'.$num.'。请及时到小程序“理车宝-客户”进行操作,祝您成单!');
|
||||
}
|
||||
}
|
||||
throw new Exception('分配成功', API_CODE_SUCCESS);
|
||||
@@ -1206,15 +1146,15 @@ class Customers extends Wxapp
|
||||
$e_c_time = date('Y-m-d') . ' 23:59:59';
|
||||
}
|
||||
if ($visit == 3) {//今日/本月线索
|
||||
$where = ['biz_id' => $this->biz_id, 'status>=' => 0, 'p_time>=' => $s_c_time
|
||||
, 'p_time<=' => $e_c_time];
|
||||
$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;
|
||||
$count = $this->customers_model->count($where);
|
||||
} else if ($visit == 5 || $visit == 7) {//今日/本月到店/战败
|
||||
$oplogs_type = $visit == 7 ? 7 : 4;//4到店7战败
|
||||
$s_c_time = strtotime($s_c_time);
|
||||
$e_c_time = strtotime($e_c_time);
|
||||
$where = ['biz_id' => $this->biz_id, 'status>=' => 0];
|
||||
$where = ['biz_id' => $this->biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1];
|
||||
$str_uids = '';
|
||||
if ($group_id == 1) {
|
||||
$str_uids = $this->myuid;
|
||||
@@ -1230,10 +1170,10 @@ class Customers extends Wxapp
|
||||
}
|
||||
}
|
||||
if ($count) {
|
||||
$fileds = 'id,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,sales_id,cont_time,c_time,p_time,if_defeat
|
||||
$fileds = 'id,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,sales_id,cont_time,c_time,if_defeat
|
||||
,of_id,of2_id,wxqy,status,biz_id,cs_biz_id,county_id,cid';
|
||||
if ($visit == 1) {
|
||||
$fileds = 'a.id,a.name,a.admin_id,a.mobile,a.level,a.is_top,a.cont_time,a.c_time,a.if_defeat,a.cf_title,a.p_time
|
||||
$fileds = 'a.id,a.name,a.admin_id,a.mobile,a.level,a.is_top,a.cont_time,a.c_time,a.if_defeat,a.cf_title
|
||||
,a.of_id,a.of2_id,a.status,a.biz_id,a.county_id,cid';
|
||||
$rows = $this->mdCustomerVisitData->select_visit($where, 'a.id desc', $page, $size, $fileds);
|
||||
$lists = $this->listCustomerField(['rows' => $rows, 'biz_type' => $biz_type, 'group_id' => $group_id]);
|
||||
@@ -1254,7 +1194,7 @@ class Customers extends Wxapp
|
||||
}
|
||||
}
|
||||
if ($mobile) {//查找关连客户
|
||||
$where = ['mobile' => $mobile, 'status>=' => 0];
|
||||
$where = ['mobile' => $mobile, 'cs_biz_id<>' => -1, 'status>=' => 0];
|
||||
$this->biz_id && $where['biz_id'] = $this->biz_id;
|
||||
$res_cus = $this->customers_model->get($where);
|
||||
if ($res_cus) {
|
||||
@@ -1414,9 +1354,9 @@ class Customers extends Wxapp
|
||||
$mobile = $params['mobile'];
|
||||
if (!$mobile) {
|
||||
return '';
|
||||
} elseif ($params['rid']) {
|
||||
} elseif ($params['rid']){
|
||||
return mobile_asterisk($mobile);
|
||||
} else {
|
||||
}else {
|
||||
return $mobile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,17 +103,16 @@ class Employees extends Wxapp
|
||||
$count = $this->app_user_model->count($where);
|
||||
$lists = $tabs = $bizs = [];
|
||||
if ($count) {
|
||||
$fileds = 'id,uname,mobile,status,group_id';
|
||||
$fileds = 'id,uname,mobile,status';
|
||||
$rows = $this->app_user_model->select($where, 'id desc', $page, $size, $fileds);
|
||||
foreach ($rows as $k => $v){
|
||||
if($v['group_id'] == 2){
|
||||
$rows[$k]['uname'] = $v['uname'].'(店长)';
|
||||
}
|
||||
}
|
||||
|
||||
$lists = $rows;
|
||||
}
|
||||
|
||||
$this->load->model("biz/biz_model");
|
||||
$re_biz = $this->biz_model->get(['id' => $this->biz_id, 'status' => 1]);
|
||||
if ($re_biz['type'] == 1) {//品牌店
|
||||
$tabs = [['id' => 1, 'name' => '本店'], ['id' => 2, 'name' => '其它门店']];
|
||||
$bizs = $this->biz_model->select(['type' => 1, 'status' => 1], 'id desc', 0, 0, 'id, biz_name as name');
|
||||
}
|
||||
$data = [
|
||||
'list' => $lists,
|
||||
'total' => $count,
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
<?php
|
||||
defined('WXAPP_APP') or exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
|
||||
class OpenApi extends Wxapp
|
||||
{
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
parent::__construct($inputs, $app_key);
|
||||
|
||||
$this->login_white = array();//登录白名单
|
||||
$this->check_status = array();//用户状态校验
|
||||
$this->check_mobile = array();//需要手机号
|
||||
$this->check_headimg = array();//授权微信信息
|
||||
$this->load->model('receiver/receiver_clues_model', 'clues_model');
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
$this->load->model('area_model');
|
||||
$this->load->library('receiver/clues_entity');
|
||||
$this->load->library('receiver/customers_entity');
|
||||
}
|
||||
|
||||
//新增线索
|
||||
public function post_clues()
|
||||
{
|
||||
$name = $this->input_param('name');
|
||||
$mobile = $this->input_param('mobile');
|
||||
$out_id = $this->input_param('out_id');
|
||||
$cf_platform = $this->input_param('cf_platform');
|
||||
$en_time = $this->input_param('en_time');
|
||||
$biz_id = $this->input_param('biz_id');
|
||||
$to_customers = $this->input_param('to_customers');
|
||||
$remark = $this->input_param('remark');
|
||||
if (!$name || !$mobile) {
|
||||
throw new Exception('参数错误', API_CODE_FAIL);
|
||||
}
|
||||
if ($out_id && $cf_platform && $this->clues_model->get(['out_id' => $out_id, 'cf_platform' => $cf_platform])) {
|
||||
throw new Exception('数据已存在', API_CODE_FAIL);
|
||||
}
|
||||
$data = [
|
||||
'name' => $name,
|
||||
'mobile' => $mobile,
|
||||
'out_id' => $out_id,
|
||||
'cf_id' => 2,
|
||||
'cf2_id' => 19,
|
||||
'cf_platform' => $cf_platform,
|
||||
'c_time' => time(),
|
||||
'en_time' => $en_time ?: date('Y-m-d H:i:s'),
|
||||
];
|
||||
if ($to_customers) {
|
||||
$data['biz_id'] = $biz_id;
|
||||
}
|
||||
$ret = $this->clues_model->add($data);
|
||||
if (is_numeric($ret)) {
|
||||
$this->clues_entity->add_log($ret, 1, 'admin', $remark ?: '新增线索', 3);
|
||||
}
|
||||
if ($to_customers) { // 分配到客户池
|
||||
$this->customers($ret);
|
||||
}
|
||||
throw new Exception('保存成功', API_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
//分配到客户表
|
||||
public function customers($clue_id)
|
||||
{
|
||||
$re = $this->clues_model->get(array('id' => $clue_id));
|
||||
if (!$re || empty($re)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '线索不存在!');
|
||||
}
|
||||
$this->load->helper("order");
|
||||
$biz = $this->biz_model->get(array('id' => $re['biz_id']));
|
||||
$add = array(
|
||||
'rid' => $re['id'],
|
||||
'cid' => create_customer_no($biz['county_id']),
|
||||
'name' => $re['name'],
|
||||
'province_id' => $re['province_id'],
|
||||
'city_id' => $re['city_id'],
|
||||
'county_id' => $re['county_id'],
|
||||
'mobile' => $re['mobile'],
|
||||
'biz_id' => $re['biz_id'],
|
||||
'level' => 'H',
|
||||
'cf_title' => '数字营销中台',
|
||||
'of_id' => $re['cf_id'],
|
||||
'of2_id' => $re['cf2_id'],
|
||||
'p_time' => $re['p_time'],
|
||||
'cont_time' => $re['cont_time'],
|
||||
'c_time' => $re['c_time'],
|
||||
);
|
||||
|
||||
$customers_id = $this->customers_model->add($add);
|
||||
if ($customers_id) {
|
||||
$this->clues_entity->add_log($re['id'], 1, 'admin', '转交门店跟进', 3);
|
||||
$this->clues_model->update(['status' => 1, 'status2' => 2], ['id' => $re['id']]);
|
||||
|
||||
//同步线索日志到客户日志
|
||||
$this->customers_entity->syn_clues($customers_id, $re['id']);
|
||||
|
||||
//短信通知店长
|
||||
// $this->load->model('app/licheb/app_licheb_users_model');
|
||||
// $where = array('biz_id' => $re['biz_id'], 'status' => 1, 'group_id' => 2);
|
||||
// $res_u = $this->app_licheb_users_model->get($where);
|
||||
// $res_u['mobile'] = 18350451617;
|
||||
// if ($re['biz_id'] != 1) {
|
||||
// b2m_send_sms($res_u['mobile'], '【理车宝】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
|
||||
// }
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function post_status()
|
||||
{
|
||||
$status_map = [
|
||||
0 => ['title' => '待确认', 'list' => [0 => '清洗中', 1 => '已派发']],
|
||||
1 => ['title' => '已成交'],
|
||||
2 => ['title' => '无效']
|
||||
];
|
||||
$out_ids = $this->input_param('out_ids');
|
||||
$cf_platform = $this->input_param('cf_platform');
|
||||
if (!$out_ids) {
|
||||
throw new Exception('参数错误', API_CODE_FAIL);
|
||||
}
|
||||
$out_id_array = explode(',', $out_ids);
|
||||
$lists = [];
|
||||
if ($out_id_array) {
|
||||
$ids = implode(',', $out_id_array);
|
||||
$where = [
|
||||
"out_id in ({$ids})" => null,
|
||||
'cf_platform' => $cf_platform,
|
||||
];
|
||||
$rows = $this->clues_model->select($where, '', 1, 2000, 'id,out_id,name,status,status2');
|
||||
foreach ($rows as $item) {
|
||||
$status2 = $status = 0;
|
||||
$customersRow = $this->customers_model->get(['rid' => $item['id']]);
|
||||
if ($customersRow) {
|
||||
$status2 = 1;
|
||||
}
|
||||
if ($this->orders_model->get(['clue_id' => $item['id']])) {
|
||||
$status = 2;
|
||||
}
|
||||
if ($item['status'] == 3) {
|
||||
$status = 3;
|
||||
}
|
||||
$lists[$item['out_id']] = [
|
||||
'id' => $item['id'],
|
||||
'out_id' => $item['out_id'],
|
||||
'status' => $status,
|
||||
'status2' => $status2,
|
||||
'status_cn' => $status_map[$status]['title'],
|
||||
'status2_cn' => $status_map[$status]['list'][$status2] ?: ''
|
||||
];
|
||||
}
|
||||
}
|
||||
return ['list' => $lists];
|
||||
}
|
||||
|
||||
public function get_biz()
|
||||
{
|
||||
$biz_id = $this->input_param('biz_id');
|
||||
if (!$biz_id) {
|
||||
throw new Exception('参数错误', API_CODE_FAIL);
|
||||
}
|
||||
$row = $this->biz_model->get(['id' => $biz_id]);
|
||||
$address = $row['address'] ?: '';
|
||||
if ($row['county_id']) {
|
||||
$areas = $this->area_model->get(['county_id' => $row['county_id']]);
|
||||
$address = $areas['province_name'] . $areas['city_name'] . $areas['county_name'] . $address;
|
||||
}
|
||||
$data = [
|
||||
'id' => $row['id'] ?: '',
|
||||
'biz_name' => $row['biz_name'] ?: '',
|
||||
'address' => $address,
|
||||
'lat' => $row['lat'] ?: '',
|
||||
'lng' => $row['lng'] ?: '',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -1,343 +0,0 @@
|
||||
<?php
|
||||
defined('WXAPP_APP') or exit('No direct script access allowed');
|
||||
require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
|
||||
class Score extends Wxapp
|
||||
{
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
parent::__construct($inputs, $app_key);
|
||||
$this->load->model('receiver/receiver_score_config_model');
|
||||
$this->load->model('receiver/receiver_score_day_model');
|
||||
$this->load->model('receiver/receiver_score_month_model');
|
||||
$this->load->model('receiver/receiver_score_log_model');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
$this->load->model('receiver/receiver_score_avg_day_model');
|
||||
$this->biz_id = $this->get_biz_id();
|
||||
$this->group_id = $this->session['group_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function get()
|
||||
{
|
||||
$max_score = 100; //最高得分
|
||||
$uid = $this->session['uid'];
|
||||
$show_biz = false;
|
||||
$type = $this->input_param('type'); // 0个人 1门店
|
||||
$day_type = $this->input_param('day_type'); // 默认0昨天 1上月
|
||||
if ($this->group_id == App_licheb_users_model::GROUP_BIZ && $type) { //店长可查看个人或门店
|
||||
$show_biz = true;
|
||||
} elseif ($this->group_id == App_licheb_users_model::GROUP_INVESTOR || $this->group_id == App_licheb_users_model::GROUP_CUSTOMER_MANAGER) { //投资人和客户成功经理 只能查看门店
|
||||
$show_biz = true;
|
||||
}
|
||||
$where = [
|
||||
'biz_id' => $this->biz_id
|
||||
];
|
||||
if (!$show_biz) {//查看个人
|
||||
$where['uid'] = $uid;
|
||||
}
|
||||
if ($day_type == 1) { //本月
|
||||
$where['day'] = date('Y-m-d');
|
||||
$where['type'] = $type ? Receiver_score_avg_day_model::TYPE_BIZ : Receiver_score_avg_day_model::TYPE_USER;
|
||||
$row = $this->receiver_score_avg_day_model->get($where);
|
||||
$up_time = date('Y-m-d');
|
||||
$title_hd = '较上日';
|
||||
} elseif ($day_type == 2) {
|
||||
$up_month = strtotime("-1 month"); //上个月时间
|
||||
$where['year'] = date('Y', $up_month);
|
||||
$where['month'] = date('m', $up_month);
|
||||
$where['type'] = $type ? Receiver_score_month_model::TYPE_BIZ : Receiver_score_month_model::TYPE_USER;
|
||||
$row = $this->receiver_score_month_model->get($where);
|
||||
$up_time = date('Y-m-01', time());
|
||||
$title_hd = '较上月';
|
||||
} else {
|
||||
$up_month = strtotime("-1 day");
|
||||
$where['day'] = date('Y-m-d', $up_month);
|
||||
$where['type'] = $type ? Receiver_score_day_model::TYPE_BIZ : Receiver_score_day_model::TYPE_USER;
|
||||
$row = $this->receiver_score_day_model->get($where);
|
||||
$up_time = date('Y-m-d', $up_month);
|
||||
$title_hd = '较上一日';
|
||||
}
|
||||
$score = ceil($row['score']) ?: 0;
|
||||
$abs_score = ceil($row['change_score']) ?: 0;
|
||||
if ($abs_score >= 0) {
|
||||
$title = $title_hd . "提升{$abs_score}分";
|
||||
$score_trend = 1;
|
||||
} else {
|
||||
$abs_score = abs($abs_score);
|
||||
$title = $title_hd . "下降{$abs_score}分";
|
||||
$score_trend = 2;
|
||||
}
|
||||
$percentage = $score / $max_score * 100;
|
||||
$score_list = [];
|
||||
if (!$day_type && !$show_biz) { //个人且非查看门店
|
||||
$scoreLogModel = new receiver_score_log_model();
|
||||
$day = date('Y-m-d', strtotime("-1 day"));
|
||||
$base_list = Receiver_score_config_model::TYPE_LIST;
|
||||
foreach ($base_list as $key => $item) {
|
||||
$where = [
|
||||
'biz_id' => $this->biz_id,
|
||||
'uid' => $uid,
|
||||
'day' => $day,
|
||||
'type' => $key
|
||||
];
|
||||
$scoreSum = $scoreLogModel->sum('score', $where);
|
||||
$operator = '';
|
||||
if ($key > 0) {
|
||||
$operator = $scoreSum['operator'] >= 0 ? '+' : '-';
|
||||
}
|
||||
if ($key == Receiver_score_config_model::TYPE_DEDUCT) {
|
||||
$operator = '-';
|
||||
}
|
||||
$score_list[] = [
|
||||
'name' => $item['name'],
|
||||
'value' => $scoreSum['score'] ? abs(ceil($scoreSum['score'])) : 0,
|
||||
'operator' => $operator
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if($type){
|
||||
$desc = "<p><h3>门店运营分</h3></p>
|
||||
<p> 门店运营分是通过统计每日店长及车管家的运营分加权平均后得出的分值,运营分按天每日更新,店内人均分数越高,门店的运营分越高。</p><br/>";
|
||||
}else{
|
||||
$desc = "<p><h3>如何提升运营分?</h3></p>
|
||||
<p> 运营分是根据个人在理车宝的基础分、线索分、订单分等方面综合计算得出的分值,运营分按天每日更新,可通过以下方式提升运营分:</p><br/>
|
||||
<p><b>基础分:</b>每日初始基本分为50分,当日登录理车宝进行信息查询、线索跟进等操作即视为开工,可再得10分。</p><br/>
|
||||
<p><b>线索分:</b>录入线索并且按要求完善信息,无论是平台分配还是自录线索都按时跟进回访并做好小记,尽可能添加客户微信并上传截图,使用系统提供的虚拟电话联系客户留存回访录音以便复盘。
|
||||
单条线索不因重复动作而多次加分,分值次日更新,每日新增/跟进的线索越多,线索分越多。</p><br/>
|
||||
<p><b>订单分:</b>新增订单并且按要求完善信息,上传相关资料。产生订单时应及时录入系统,否则会因订单时间逻辑不符而导致扣分。分值次日更新,新增订单越多,相关资料上传越完善,订单分越多。</p><br/>
|
||||
<p><b>扣分:</b>理车宝使用过程,未按规范要求操作,将会导致运营分被扣。</p><p>具体如下:</p>
|
||||
<p>* 线索逾期未跟进;</p>
|
||||
<p>* 店长分配线索后未及时跟进,时间超过15分钟;</p>
|
||||
<p>* 线索未提前录入,与下单时间间隔少于T+1;</p>
|
||||
<p>* 订单未及时录入,导致开票时间早于订单录入时间;</p>
|
||||
<p>* 平台下发线索,分配时间超过10分钟[店长];</p>
|
||||
<p>* 战败申请当日未处理[店长];</p>";
|
||||
}
|
||||
|
||||
return [
|
||||
'score' => $score,
|
||||
'percentage' => $percentage,
|
||||
'title' => $title,
|
||||
'sub_title' => '当前显示为昨日运营情况评分',
|
||||
'u_time_text' => "*更新于" . $up_time,
|
||||
'score_trend' => $score_trend, //控制样式:1 上升 、2 下降
|
||||
'desc' => $desc,
|
||||
'score_list' => $score_list
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分数排行
|
||||
* @return array
|
||||
*/
|
||||
public function get_lists()
|
||||
{
|
||||
$type = $this->input_param('type'); // 默认0店内排行 1门店排行
|
||||
$day_type = $this->input_param('day_type'); // 默认0昨天 1本月 2上月
|
||||
$limit = $type ? 100 : 10;
|
||||
if ($day_type == 1) {
|
||||
$result = Receiver_score_avg_day_model::getTopLists($type, $this->biz_id, $limit);
|
||||
} elseif ($day_type == 2) {
|
||||
$result = Receiver_score_month_model::getTopLists($type, $this->biz_id, $limit);
|
||||
} else {
|
||||
$result = Receiver_score_day_model::getTopLists($type, $this->biz_id, $limit);
|
||||
}
|
||||
return [
|
||||
'lists' => $result['lists'],
|
||||
'day' => $result['day']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_detail()
|
||||
{
|
||||
$uid = $this->session['uid'];
|
||||
$base_list = Receiver_score_config_model::TYPE_LIST;
|
||||
$day = date('Y-m-d', strtotime("-1 day"));
|
||||
$where = [
|
||||
'day' => $day,
|
||||
'type' => Receiver_score_day_model::TYPE_USER,
|
||||
'uid' => $uid,
|
||||
'biz_id' => $this->biz_id
|
||||
];
|
||||
$dayRow = $this->receiver_score_day_model->get($where);
|
||||
$user_score = $dayRow['score'] ? ceil($dayRow['score']) : 0;
|
||||
$change_score = $dayRow['change_score'] ? ceil($dayRow['change_score']) : 0;
|
||||
$up_data_score = $change_score;
|
||||
$score_trend = 1;
|
||||
if ($up_data_score >= 0) {
|
||||
$change_text = '较上一日提升' . $up_data_score . '分';
|
||||
} else {
|
||||
$change_text = '较上一日下降' . abs($up_data_score) . '分';
|
||||
$score_trend = 2;
|
||||
}
|
||||
$data = [];
|
||||
if ($base_list) {
|
||||
$scoreLogModel = new receiver_score_log_model();
|
||||
foreach ($base_list as $key => $item) {
|
||||
$where = [
|
||||
'biz_id' => $this->biz_id,
|
||||
'uid' => $uid,
|
||||
'day' => $day,
|
||||
'type' => $key
|
||||
];
|
||||
$scoreSum = $scoreLogModel->sum('score', $where);
|
||||
$score = $scoreSum['score'] ? ceil($scoreSum['score']) : 0;
|
||||
$trend = $score >= 0 ? 1 : 2;
|
||||
$data_list = Receiver_score_log_model::getUserLogLists($this->biz_id, $uid, $day, $key);
|
||||
$data[] = [
|
||||
'name' => $item['name'],
|
||||
'score' => $score,
|
||||
'trend' => $trend,
|
||||
'data' => $data_list
|
||||
];
|
||||
}
|
||||
}
|
||||
return ['data' => $data, 'score' => $user_score, 'up_data_score' => $up_data_score, 'change_text' => $change_text, 'score_trend' => $score_trend];
|
||||
}
|
||||
|
||||
public function get_radar()
|
||||
{
|
||||
$day_type = $this->input_param('day_type'); // 默认0昨天 1本月 2上月
|
||||
if($day_type==2){
|
||||
$s_time = date('Y-m-01 00:00:00', strtotime('last month'));
|
||||
$e_time = date('Y-m-t 23:59:59', strtotime('last month'));
|
||||
}elseif($day_type==1){
|
||||
$s_time = date('Y-m-01 00:00:00');
|
||||
$e_time = date('Y-m-d 23:59:59');
|
||||
}else{
|
||||
$s_time = date('Y-m-d 00:00:00',strtotime("-1 day"));
|
||||
$e_time = date('Y-m-d 23:59:59',strtotime("-1 day"));
|
||||
}
|
||||
|
||||
$ts_s_time = strtotime($s_time);
|
||||
$ts_e_time = strtotime($e_time);
|
||||
|
||||
$biz = (new Biz_model())->get(['id' => $this->biz_id]);
|
||||
$province_id = $biz['province_id'];
|
||||
$bizs = (new Biz_model())->select(['province_id' => $province_id, 'status' => 1]);
|
||||
$biz_id_arr = implode(',', array_unique(array_column($bizs, 'id')));
|
||||
!$biz_id_arr && $biz_id_arr = 0;
|
||||
$biz_count = count($bizs);
|
||||
|
||||
$names = [ '拓客能力', '跟进能力', '邀约能力', '成交能力', '交付能力'];
|
||||
$series_value = [];
|
||||
$max_total = [20,20,20,20,20];
|
||||
$indicator = [];
|
||||
|
||||
//拓客能力
|
||||
$where_max = $where = [
|
||||
'status>=' => 0,
|
||||
'of_id' => 3,
|
||||
'c_time >=' => $ts_s_time,
|
||||
'c_time <=' => $ts_e_time,
|
||||
];
|
||||
$where_max["biz_id in ($biz_id_arr)"] = null;
|
||||
$max = $this->customers_model->count($where_max);
|
||||
$where['biz_id'] = $this->biz_id;
|
||||
$value = $this->customers_model->count($where);
|
||||
|
||||
if($value){
|
||||
$value = $value / $max * 40;
|
||||
}
|
||||
$value > 20 && $value = 20;
|
||||
$value < 4 && $value = 4;
|
||||
|
||||
$series_value[] = $value;
|
||||
|
||||
//跟进能力
|
||||
$where_max = $where = [
|
||||
'status>=' => 0,
|
||||
"id in (select DISTINCT customer_id from lc_receiver_customer_oplogs where c_time>={$ts_s_time} and c_time<={$ts_e_time} and cf_platform like 'wxapp' and log like '跟进方式%')" => null
|
||||
];
|
||||
$where_max["biz_id in ($biz_id_arr)"] = null;
|
||||
$max = $this->customers_model->count($where_max);
|
||||
$where['biz_id'] = $this->biz_id;
|
||||
$value = $this->customers_model->count($where);
|
||||
|
||||
if($value){
|
||||
$value = $value / $max * 40;
|
||||
}
|
||||
$value > 20 && $value = 20;
|
||||
$value < 4 && $value = 4;
|
||||
|
||||
$series_value[] = $value;
|
||||
|
||||
//邀约能力
|
||||
$where_max = $where = [
|
||||
'status>=' => 0,
|
||||
'dt_time >=' => $s_time,
|
||||
'dt_time <=' => $e_time,
|
||||
];
|
||||
$where_max["biz_id in ($biz_id_arr)"] = null;
|
||||
$max = $this->customers_model->count($where_max);
|
||||
$where['biz_id'] = $this->biz_id;
|
||||
$value = $this->customers_model->count($where);
|
||||
|
||||
if($value){
|
||||
$value = $value / $max * 40;
|
||||
}
|
||||
$value > 20 && $value = 20;
|
||||
$value < 4 && $value = 4;
|
||||
|
||||
$series_value[] = $value;
|
||||
|
||||
//成交能力
|
||||
$where_max = $where = [
|
||||
'status>=' => 0,
|
||||
'order_time >=' => $s_time,
|
||||
'order_time <=' => $e_time,
|
||||
];
|
||||
$where_max["biz_id in ($biz_id_arr)"] = null;
|
||||
$max = $this->orders_model->count($where_max);
|
||||
$where["biz_id"] = $this->biz_id;
|
||||
$value = $this->orders_model->count($where);
|
||||
|
||||
if($value){
|
||||
$value = $value / $max * 40;
|
||||
}
|
||||
$value > 20 && $value = 20;
|
||||
$value < 4 && $value = 4;
|
||||
|
||||
$series_value[] = $value;
|
||||
|
||||
//交付能力
|
||||
$where_max = $where = [
|
||||
'status>=' => 0,
|
||||
'over_time >=' => $s_time,
|
||||
'over_time <=' => $e_time,
|
||||
];
|
||||
$where_max["biz_id in ($biz_id_arr)"] = null;
|
||||
$max = $this->orders_model->count($where_max);
|
||||
$where["biz_id"] = $this->biz_id;
|
||||
$value = $this->orders_model->count($where);
|
||||
|
||||
if($value){
|
||||
$value = $value / $max * 40;
|
||||
}
|
||||
$value > 20 && $value = 20;
|
||||
$value < 4 && $value = 4;
|
||||
|
||||
$series_value[] = $value;
|
||||
|
||||
foreach ($names as $key => $value) {
|
||||
$indicator[] = array('name' => $value, 'max' => $max_total[$key]);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'indicator' => $indicator,
|
||||
'series_value' => $series_value
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class Sign extends Wxapp
|
||||
"(province_id={$area['province_id']} or province_id=0)" => null
|
||||
];
|
||||
$item_row = $this->item_model->get($where);
|
||||
$time_out = 1800;
|
||||
$time_out = 30;
|
||||
$item = [];
|
||||
if ($item_row) {
|
||||
$item['title'] = $item_row['title'];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -135,7 +135,6 @@ class User extends Wxapp
|
||||
*/
|
||||
protected function get()
|
||||
{
|
||||
$this->add_user_score();
|
||||
$uid = $this->session['uid'];
|
||||
$biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
|
||||
|
||||
@@ -306,7 +305,7 @@ class User extends Wxapp
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
// $this->load->model('receiver/order/receiver_order_signs_model', 'order_signs_model');
|
||||
$this->load->model('receiver/receiver_customers_visit_data_model', 'mdCustomerVisitData');
|
||||
$where = ['status>' => -1, 'is_top' => 1, 'biz_id' => $biz_id, 'status!=' => 2];
|
||||
$where = ['status>' => -1, 'is_top' => 1, 'biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status!=' => 2];
|
||||
$group_id == 1 && $where['admin_id'] = $uid;
|
||||
$gz_count = $this->customers_model->count($where);
|
||||
$where = ['status' => 0, 'biz_id' => $biz_id];
|
||||
@@ -319,7 +318,7 @@ class User extends Wxapp
|
||||
if ($group_id == 1) {
|
||||
$customer_op_list = [];
|
||||
} else {
|
||||
$where = ['admin_id' => 0, 'biz_id' => $biz_id, 'status>=' => 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' => 1, 'status2' => 1]);
|
||||
@@ -403,17 +402,21 @@ class User extends Wxapp
|
||||
$s_month = date('Y-m-01', strtotime(date("Y-m-d"))) . ' 00:00:00';
|
||||
$e_month = date('Y-m-d', strtotime("$s_month +1 month -1 day")) . ' 23:59:59';
|
||||
//线索
|
||||
$where_today_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'p_time>=' => $s_today, 'p_time<=' => $e_today];
|
||||
$where_month_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'p_time>=' => $s_month, 'p_time<=' => $e_month];
|
||||
$where_today_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)];
|
||||
$where_month_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)];
|
||||
//到店
|
||||
$where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'dt_time >= ' => $s_today, 'dt_time<=' => $e_today];
|
||||
$where_month_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'dt_time >= ' => $s_month, 'dt_time<=' => $e_month];
|
||||
$where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0,
|
||||
"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];
|
||||
$where_month_dd = ['biz_id' => $biz_id, 'status>=' => 0,
|
||||
"id in(select customer_id from lc_receiver_customer_oplogs where type=4 and uid in({$str_uids}) and c_time>=" . strtotime($s_month) . " and c_time<=" . strtotime($e_month) . ")" => null];
|
||||
//订单
|
||||
$where_today_order = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)];
|
||||
$where_month_order = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)];
|
||||
//战败
|
||||
$where_today_defeat = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1, 'def_time >= ' => $s_today, 'def_time<=' => $e_today];
|
||||
$where_month_defeat = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1, 'def_time >= ' => $s_month, 'def_time<=' => $e_month];
|
||||
$where_today_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_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;
|
||||
@@ -488,7 +491,7 @@ class User extends Wxapp
|
||||
$o_where['status'] = 1;
|
||||
$bizs = $this->biz_model->get_by_id_arr($biz_id_arr, $o_where, $fileds);
|
||||
} else {
|
||||
!$province_id && $province_id = '350000';
|
||||
!$province_id && $province_id = '430000';
|
||||
$province_id && $o_where = ['province_id' => $province_id];
|
||||
$city_id && $o_where = ['city_id' => $city_id];
|
||||
$o_where['status'] = 1;
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
<?php
|
||||
defined('WXAPP_APP') or exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Created by Vim.
|
||||
* User: lcc
|
||||
* Desc: 晓致虚拟号
|
||||
* Date: 2021/07/26
|
||||
* Time: 10:17
|
||||
*/
|
||||
require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
|
||||
|
||||
class Xz extends Wxapp
|
||||
{
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
parent::__construct($inputs, $app_key);
|
||||
|
||||
$this->login_white = array();//登录白名单
|
||||
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
$this->log_file = 'call.log';
|
||||
}
|
||||
|
||||
protected function get()
|
||||
{
|
||||
$id = $this->input_param('id');
|
||||
$type = intval($this->input_param('type'));
|
||||
!$type && $type = 0;
|
||||
$session = $this->session;
|
||||
$admin_id = $session['uid'];
|
||||
$cf_title = 'customer';
|
||||
$cus_id = $id;
|
||||
$row = $this->customers_model->get(['id' => $cus_id]);
|
||||
if (!$row || !$row['mobile']) {
|
||||
throw new Hd_Exception('用户不存在', API_CODE_INVILD_PARAM);
|
||||
}
|
||||
$customer_mobile = $row['mobile'];
|
||||
$user_mobile = $session['mobile'];
|
||||
$json = $session['jsondata'] ? json_decode($session['jsondata'], true) : array();
|
||||
if ($json && $json['hdy'] && $json['hdy']['tel']) {
|
||||
$user_mobile = $json['hdy']['tel'];
|
||||
}
|
||||
$redis = &load_cache('redis');
|
||||
$cache_key = "XZ_LICHEB_MOBILEA_{$user_mobile}_MOBILEB_{$customer_mobile}_{$admin_id}";
|
||||
$call_mobile = $redis->get($cache_key);
|
||||
if (!$call_mobile) {
|
||||
$this->config->load('xcall');
|
||||
$params = [
|
||||
'app_id' => $this->config->item('app_id'),
|
||||
'app_key' => $this->config->item('app_key'),
|
||||
];
|
||||
$seq_id = create_order_no();
|
||||
$xcall = new Xcall($params);
|
||||
$maxBindingTime = 10;//绑定时间
|
||||
$result = $xcall->ABXbind($user_mobile, $customer_mobile, $seq_id, $maxBindingTime);
|
||||
if (!$result['code']) { //绑定失败
|
||||
debug_log("xz_failed_bind:customer_mobile【{$customer_mobile}】", $this->log_file);
|
||||
debug_log("xz_result:" . json_encode($result, JSON_UNESCAPED_UNICODE), $this->log_file);
|
||||
throw new Hd_Exception($result['msg'], API_CODE_FAIL);
|
||||
} else {
|
||||
$this->data['middlenumber'] = $result['data']['virtualMobile'];
|
||||
$add_data = [
|
||||
'call_id' => $seq_id,
|
||||
'display_number' => $result['data']['virtualMobile'],
|
||||
'biz_id' => $row['biz_id'],
|
||||
'cf_id' => $cus_id,
|
||||
'cf_uid' => $admin_id,
|
||||
'cf_title' => $cf_title,
|
||||
'cf_platform' => 'api',
|
||||
'json_data' => json_encode(['uname' => $session['uname']], JSON_UNESCAPED_UNICODE),
|
||||
'c_time' => time()
|
||||
];
|
||||
$this->receiver_xz_model->add($add_data);
|
||||
$call_mobile = $result['data']['virtualMobile'];
|
||||
$redis->save($cache_key, $call_mobile, $maxBindingTime * 60);
|
||||
}
|
||||
}
|
||||
$data['mobile'] = $call_mobile;
|
||||
return $data;
|
||||
}
|
||||
|
||||
//电话统计
|
||||
protected function get_stat()
|
||||
{
|
||||
$biz_id = $this->input_param('biz_id');
|
||||
$day = $this->input_param('day');
|
||||
$admin_id = $this->input_param('admin_id');
|
||||
if (!$biz_id) {
|
||||
throw new Hd_Exception('参数错误', API_CODE_INVILD_PARAM);
|
||||
}
|
||||
//接通次数
|
||||
$where1 = [
|
||||
'cf_title' => 'customer',
|
||||
'cf_platform' => 'api',
|
||||
'biz_id' => $biz_id,
|
||||
'status' => 1,
|
||||
];
|
||||
if ($day) {
|
||||
$s_time = date('Y-m-d 00:00:00', strtotime($day));
|
||||
$e_time = date('Y-m-t 23:59:59', strtotime($day));
|
||||
$where1["c_time>="] = strtotime($s_time);
|
||||
$where1["c_time<="] = strtotime($e_time);
|
||||
}
|
||||
$admin_id && $where1['cf_uid'] = $admin_id;
|
||||
$where2 = [
|
||||
'duration' => 0
|
||||
];
|
||||
$where = array_merge($where1, $where2);
|
||||
$num = $this->receiver_xz_model->count($where);
|
||||
$where2 = [
|
||||
'duration>' => 0
|
||||
];
|
||||
$where = array_merge($where1, $where2);
|
||||
$count_call = $this->receiver_xz_model->count($where); //接通次数
|
||||
$sum_call = $this->receiver_xz_model->sum('duration', $where); //接通总时长
|
||||
$call_time = $sum_call['duration'] / 60000;
|
||||
if ($call_time) {
|
||||
$avg_time = $call_time / $count_call;
|
||||
}
|
||||
$data = [
|
||||
'call_time' => round($call_time, 2),
|
||||
'avg_time' => round($avg_time, 2),
|
||||
'unget_num' => $num
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -956,7 +956,7 @@ if (!function_exists('http_host_com')) {
|
||||
if ($type == 'api') {
|
||||
$url = 'https://api.ss.haodian.cn/';
|
||||
} else if ($type == 'home') {
|
||||
$url = "http://www.ss.haodian.cn/";
|
||||
$url = "";
|
||||
} else if ($type == 'admin') {
|
||||
$url = "http://admin.ss.haodian.cn/";
|
||||
}
|
||||
@@ -964,7 +964,7 @@ if (!function_exists('http_host_com')) {
|
||||
if ($type == 'api') {
|
||||
$url = "https://sapi.liche.cn/";
|
||||
} else if ($type == 'home') {
|
||||
$url = "https://space.liche.cn/";
|
||||
$url = "";
|
||||
} else if ($type == 'admin') {
|
||||
$url = "https://sadmin.liche.cn/";
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ class Excel extends PHPExcel
|
||||
|
||||
$row = array();
|
||||
foreach ($indexs_key as $col) {
|
||||
if (in_array($col, array('sid', 'refund_no', 'id_card')) && is_numeric($v[$col])) {
|
||||
if (in_array($col, array('sid', 'refund_no')) && is_numeric($v[$col])) {
|
||||
$row[] = iconv('utf-8', 'GBK//IGNORE', "=\"{$v[$col]}\"");
|
||||
} else {
|
||||
$row[] = iconv('utf-8', 'GBK//IGNORE', $v[$col]);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Date: 2020/4/14
|
||||
* Time: 21:54
|
||||
*/
|
||||
class Hd_exception extends CI_Exceptions{
|
||||
class Hd_exception extends Exception{
|
||||
public function __construct($message = "", $code = 0, Exception $previous = null){
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* 通用curl
|
||||
* User: bleachin
|
||||
*/
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Mycurl
|
||||
{
|
||||
private $host = '';
|
||||
private $user_agent = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36';
|
||||
private $cookie = '';
|
||||
|
||||
private $headers = array();
|
||||
private $post_data = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setHeaders();
|
||||
}
|
||||
|
||||
public function setHost($host='')
|
||||
{
|
||||
$this->host = $host;
|
||||
}
|
||||
|
||||
public function setUserAgent($user_agent='')
|
||||
{
|
||||
$this->user_agent = $user_agent;
|
||||
}
|
||||
|
||||
public function setCookie($cookie='')
|
||||
{
|
||||
$this->cookie = $cookie;
|
||||
}
|
||||
|
||||
public function setHeaders($headers='')
|
||||
{
|
||||
if($headers&&is_array($headers)){
|
||||
$_headers = $headers;
|
||||
}else{
|
||||
$_headers = array();
|
||||
$_headers[] = $this->host;
|
||||
// $_headers[] = 'Accept-Encoding: gzip, deflate, sdch';
|
||||
$_headers[] = $this->user_agent;
|
||||
$_headers[] = $this->cookie;
|
||||
|
||||
$headers && $_headers[] = $headers;
|
||||
}
|
||||
$this->headers = $_headers;
|
||||
}
|
||||
|
||||
public function httpGet($url='', $data=array())
|
||||
{
|
||||
$res = false;
|
||||
|
||||
if (!$url) return $res;
|
||||
|
||||
if ($data)
|
||||
{
|
||||
$url = $url.'?'.$this->buildGetQuery($data);
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
//关闭https验证
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
if($this->headers)
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);
|
||||
}
|
||||
|
||||
$res = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* post 通用方法
|
||||
* @param string $url [description]
|
||||
* @param [type] $data [description]
|
||||
* @param string $type post请求的数据类型
|
||||
* @param string $file_path 文件的绝对路径,类似APPPATH.'public/img/'.$photo_path
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function httpPost($url='', $data, $type='', $file_path='',$time_out = 60)
|
||||
{
|
||||
$res = false;
|
||||
|
||||
if (!$url) return $res;
|
||||
if ($file_path) $file_path = realpath($file_path);
|
||||
|
||||
if (!$type || $type=='is_file'|| $type=='xml') {
|
||||
$this->post_data = $data;
|
||||
}elseif($data && $type=='is_json'){
|
||||
$this->post_data = $this->buildJsonQuery($data);
|
||||
$this->headers[] = 'Content-Type: application/json; charset=UTF-8';
|
||||
}elseif($data && $type=='is_form')
|
||||
{
|
||||
$this->post_data = http_build_query($data);
|
||||
$this->headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
|
||||
}elseif($data && $type=='xml'){
|
||||
$this->headers[] = 'Content-type: text/xml';
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_ENCODING, ''); // 重要,否则采集数据时会乱码,乱码检测的编码格式为cp936
|
||||
//关闭https验证
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
if ($file_path && $type=='is_file')
|
||||
{
|
||||
if (class_exists('\CURLFile'))
|
||||
{
|
||||
$file_path = new \CURLFile($file_path);
|
||||
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); // >=5.5.0
|
||||
}
|
||||
else
|
||||
{
|
||||
if (defined('CURLOPT_SAFE_UPLOAD')) // 非5.6.0,是5.5.0以下手动设置了true
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); // <=5.5.0
|
||||
}
|
||||
|
||||
$file_path = "@".$file_path; //‘@’符号告诉服务器为上传资源
|
||||
}
|
||||
}
|
||||
|
||||
if($this->headers) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->post_data);
|
||||
if($time_out){ //超时时间
|
||||
// 在尝试连接时等待的秒数
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $time_out);
|
||||
// 最大执行时间
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $time_out);
|
||||
}
|
||||
|
||||
$res = curl_exec($ch);
|
||||
|
||||
if(curl_errno( $ch )) {
|
||||
$errno = curl_errno( $ch );
|
||||
$info = curl_getinfo( $ch );
|
||||
print_r($errno);
|
||||
print_r($info);
|
||||
}
|
||||
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* put 通用方法
|
||||
* @param string $url [description]
|
||||
* @param [type] $data [description]
|
||||
* @param string $type put请求的数据类型
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function httpPut($url='', $data, $type='',$time_out = 60){
|
||||
$res = false;
|
||||
|
||||
if (!$url) return $res;
|
||||
|
||||
if (!$type || $type=='is_file'|| $type=='xml') {
|
||||
$this->post_data = $data;
|
||||
}elseif($data && $type=='is_json'){
|
||||
$this->post_data = $this->buildJsonQuery($data);
|
||||
$this->headers[] = 'Content-Type: application/json; charset=UTF-8';
|
||||
}elseif($data && $type=='is_form')
|
||||
{
|
||||
$this->post_data = http_build_query($data);
|
||||
$this->headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
|
||||
}elseif($data && $type=='xml'){
|
||||
$this->headers[] = 'Content-type: text/xml';
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); //定义请求类型
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->post_data);
|
||||
|
||||
if($this->headers) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);
|
||||
}
|
||||
if($time_out){ //超时时间
|
||||
// 在尝试连接时等待的秒数
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $time_out);
|
||||
// 最大执行时间
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $time_out);
|
||||
}
|
||||
|
||||
$res = curl_exec($ch);
|
||||
|
||||
if(curl_errno( $ch )) {
|
||||
$errno = curl_errno( $ch );
|
||||
$info = curl_getinfo( $ch );
|
||||
print_r($errno);
|
||||
print_r($info);
|
||||
}
|
||||
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($ch);
|
||||
return $res;
|
||||
}
|
||||
private function buildGetQuery($data)
|
||||
{
|
||||
$querystring = '';
|
||||
if (is_array($data)) {
|
||||
|
||||
foreach ($data as $key => $val) {
|
||||
if (is_array($val)) {
|
||||
foreach ($val as $val2) {
|
||||
$querystring .= urlencode($key).'='.urlencode($val2).'&';
|
||||
}
|
||||
} else {
|
||||
$querystring .= urlencode($key).'='.urlencode($val).'&';
|
||||
}
|
||||
}
|
||||
$querystring = substr($querystring, 0, -1);
|
||||
} else {
|
||||
$querystring = $data;
|
||||
}
|
||||
return $querystring;
|
||||
}
|
||||
|
||||
private function buildJsonQuery($data)
|
||||
{
|
||||
$querystring = '';
|
||||
if (is_array($data)) {
|
||||
$querystring=json_encode($data);
|
||||
}
|
||||
return $querystring;
|
||||
}
|
||||
}
|
||||
@@ -29,11 +29,11 @@ class Customers_entity
|
||||
* @param string $cf_platform
|
||||
* @return mixed
|
||||
*/
|
||||
public function add_log_visit($customer_id, $uid, $uname, $content, $type = '', $visit = 0, $imgs = [], $cf_platform = 'wxapp', $sub_type = '')
|
||||
public function add_log_visit($customer_id, $uid, $uname, $content, $type = '', $visit = 0, $imgs = [], $cf_platform = 'wxapp')
|
||||
{
|
||||
$result = '';
|
||||
if ($content) {
|
||||
$result = $this->add_log($customer_id, $uid, $uname, $content, $type, $cf_platform, $imgs, '', $sub_type);
|
||||
$result = $this->add_log($customer_id, $uid, $uname, $content, $type, $cf_platform, $imgs);
|
||||
}
|
||||
if ($visit && ($result || !$content)) {//更新客户已跟进
|
||||
if ($type == 1 || $type == 2) {//1发短信2拨打号码 不算入已跟进
|
||||
@@ -61,7 +61,7 @@ class Customers_entity
|
||||
* @param $c_time int 创建日期
|
||||
* @return string
|
||||
*/
|
||||
public function add_log($customer_id, $uid, $uname, $content, $type = '', $cf_platform = 'wxapp', $imgs = [], $c_time = '', $sub_type = '')
|
||||
public function add_log($customer_id, $uid, $uname, $content, $type = '', $cf_platform = 'wxapp', $imgs = [], $c_time = '')
|
||||
{
|
||||
$this->ci->load->model('receiver/receiver_customer_oplogs_model', 'customer_oplogs_model');
|
||||
if ($type == 4 || $type == 5) {//到店或试驾,一天只记录一次
|
||||
@@ -104,7 +104,6 @@ class Customers_entity
|
||||
$uname && $add_data['uname'] = $uname;
|
||||
$type && $add_data['type'] = $type;
|
||||
$cf_platform && $add_data['cf_platform'] = $cf_platform;
|
||||
$sub_type && $add_data['sub_type'] = $sub_type;
|
||||
$imgs && $add_data['imgs'] = json_encode($imgs, JSON_UNESCAPED_UNICODE);
|
||||
$result = $this->ci->customer_oplogs_model->add($add_data);
|
||||
if (($type == 2 || $type == 1) && $result) { //更新最后联系时间
|
||||
|
||||
@@ -76,29 +76,18 @@ class Order_datas_entity
|
||||
return ['code' => 0, 'msg' => $result['msg']];
|
||||
}
|
||||
$data = $result['data']['CarInvoiceInfos'];
|
||||
$bill_name = $bill_code = $bill_time = '';
|
||||
$row = $this->ci->orders_model->get(['id' => $oid]);
|
||||
foreach ($data as $val) {
|
||||
$bill_code = $bill_time = '';
|
||||
foreach ($data as $key => $val) {
|
||||
if ($val['Name'] == '开票日期') {
|
||||
$bill_time = $val['Value'];
|
||||
}
|
||||
if ($val['Name'] == '发票代码') {
|
||||
$bill_code = $val['Value'];
|
||||
}
|
||||
if ($val['Name'] == '购买方名称'){
|
||||
$bill_name = $val['Value'];
|
||||
}
|
||||
}
|
||||
if (!$bill_code)
|
||||
return ['code' => 0, 'msg' => '未识别到发票代码'];
|
||||
if ($bill_name != $row['name'])
|
||||
return ['code' => 0, 'msg' => '车主信息不一致'];
|
||||
|
||||
if (!$bill_code) return ['code' => 0, 'msg' => '未识别到发票代码'];
|
||||
//更新订单开票时间
|
||||
if($bill_time){
|
||||
$this->ci->orders_model->update(['bill_time' => $bill_time], ['id' => $oid]);
|
||||
}
|
||||
|
||||
$bill_time && $this->ci->orders_model->update(['bill_time' => $bill_time], ['id' => $oid]);
|
||||
return ['code' => 1, 'msg' => '识别成功', 'data' => $data];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Orders_entity
|
||||
'buyerType' => $order_row['main_type'] ? 2 : 1,
|
||||
'buyerName' => $order_row['name'],
|
||||
'buyerPhone' => $order_row['mobile'],
|
||||
'specId' => intval($car_row['id']),
|
||||
'specId' => intval($car_row['third_car_id']),
|
||||
'outOrderId' => $order_row['sid'],
|
||||
'outLeadId' => $customer_row['cid'],
|
||||
'outOrderCreateTime' => date('Y-m-d H:i:s', $order_row['c_time']),
|
||||
|
||||
@@ -1,264 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Score_entity
|
||||
{
|
||||
|
||||
private $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = &get_instance();
|
||||
$this->ci->load->model('receiver/receiver_score_config_model');
|
||||
$this->ci->load->model('receiver/receiver_score_log_model');
|
||||
$this->ci->load->model('receiver/receiver_customers_model');
|
||||
$this->ci->load->model('receiver/receiver_customer_oplogs_model');
|
||||
$this->ci->load->model('receiver/order/receiver_orders_model');
|
||||
$this->ci->load->model('receiver/order/receiver_order_oplogs_model');
|
||||
$this->ci->load->model('receiver/receiver_customers_visit_data_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始直接入口
|
||||
* @param $day
|
||||
* @param $uid
|
||||
* @param $group_id
|
||||
* @param $biz_id
|
||||
* @return true
|
||||
*/
|
||||
public static function init($day, $uid, $group_id, $biz_id)
|
||||
{
|
||||
$typeList = Receiver_score_config_model::TYPE_LIST;
|
||||
foreach ($typeList as $k => $v) {
|
||||
$type = $k;
|
||||
if (is_array($v['sub_list'])) {
|
||||
foreach ($v['sub_list'] as $k2 => $v2) {
|
||||
$sub_type = $k2;
|
||||
self::addLogByType($day, $uid, $group_id, $biz_id, $type, $sub_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加记录
|
||||
* @param $day
|
||||
* @param $uid
|
||||
* @param $group_id
|
||||
* @param $biz_id
|
||||
* @param $type
|
||||
* @param $sub_type
|
||||
* @return true
|
||||
*/
|
||||
public static function addLogByType($day, $uid, $group_id, $biz_id, $type, $sub_type)
|
||||
{
|
||||
switch ($type) {
|
||||
case Receiver_score_config_model::TYPE_BASE: //基础分
|
||||
if ($sub_type == Receiver_score_config_model::TYPE_BASE_DEFAULT) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, '基础分', 1);
|
||||
}
|
||||
if ($sub_type == Receiver_score_config_model::TYPE_BASE_KG) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, '开工', 1, 0, 0);
|
||||
}
|
||||
break;
|
||||
case Receiver_score_config_model::TYPE_CLUE:
|
||||
$receiverCustomersModel = new Receiver_customers_model();
|
||||
if ($sub_type == Receiver_score_config_model::TYPE_CLUE_ADD) { //添加线索
|
||||
$where = [
|
||||
'status>=' => 0, 'rid' => 0, 'sales_id' => $uid, 'biz_id' => $biz_id,
|
||||
'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59')
|
||||
];
|
||||
$rows = $receiverCustomersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '新增线索';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_CLUE_ADD_WX) { //添加微信
|
||||
$receiverCustomerOplogsModel = new Receiver_customer_oplogs_model();
|
||||
$where = [
|
||||
'uid' => $uid, 'type' => 10,
|
||||
'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59')
|
||||
];
|
||||
$rows = $receiverCustomerOplogsModel->select($where, '', 1, 1000, 'DISTINCT(customer_id)');
|
||||
$desc = '添加微信';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['customer_id'], 2, $val['customer_id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_CLUE_ADD_GJ) { //跟进
|
||||
$receiverCustomerOplogsModel = new Receiver_customer_oplogs_model();
|
||||
$where = [
|
||||
'uid' => $uid, 'type' => 0, 'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59'), 'cf_platform' => 'wxapp', 'log like "跟进方式%"' => null
|
||||
];
|
||||
$rows = $receiverCustomerOplogsModel->select($where, '', 1, 1000, 'DISTINCT(customer_id)');
|
||||
$desc = '跟进小记';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['customer_id'], 2, $val['customer_id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_CLUE_ADD_TEL) { //电话
|
||||
$receiverCustomerOplogsModel = new Receiver_customer_oplogs_model();
|
||||
$where = [
|
||||
'uid' => $uid, 'type' => 2, 'cf_platform' => 'wxapp',
|
||||
'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59')
|
||||
];
|
||||
$rows = $receiverCustomerOplogsModel->select($where, '', 1, 1000, 'DISTINCT(customer_id)');
|
||||
$desc = '电话邀约';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['customer_id'], 2, $val['customer_id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Receiver_score_config_model::TYPE_ORDER:
|
||||
if ($sub_type == Receiver_score_config_model::TYPE_ORDER_ADD) { //新增订单
|
||||
$receiverOrdersModel = new Receiver_orders_model();
|
||||
$where = [
|
||||
'status>=' => 0, 'sale_id' => $uid, 'biz_id' => $biz_id,
|
||||
'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59')
|
||||
];
|
||||
$rows = $receiverOrdersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '新增订单';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_ORDER_UPLOAD_DATA) { //订单上传资料
|
||||
$receiverOrderOplogModel = new Receiver_order_oplogs_model();
|
||||
$where = [
|
||||
'uid' => $uid, 'type' => 1, 'cf_platform' => 'wxapp', "log != ''" => null,
|
||||
'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59')
|
||||
];
|
||||
$rows = $receiverOrderOplogModel->select($where, '', 1, 1000, 'DISTINCT order_id,log');
|
||||
$desc = '上传资料';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['order_id'], 2, $val['log']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Receiver_score_config_model::TYPE_DEDUCT:
|
||||
if ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_CLUE_TIMEOUT) {
|
||||
$receiverCustomersModel = new Receiver_customers_model();
|
||||
$where = [
|
||||
'status>=' => 0, 'rid>' => 0, 'sales_id' => $uid, 'biz_id' => $biz_id,
|
||||
'sales_p_time>=' => $day . ' 00:00:00', 'sales_p_time<=' => $day . ' 23:59:59',
|
||||
'UNIX_TIMESTAMP(u_time)-UNIX_TIMESTAMP(sales_p_time) ' > 15 * 60
|
||||
];
|
||||
$rows = $receiverCustomersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '线索跟进时间超过15分钟';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_BILL_TIMEOUT) {
|
||||
$receiverOrdersModel = new Receiver_orders_model();
|
||||
$where = [
|
||||
'status>=' => 0, 'sale_id' => $uid, 'biz_id' => $biz_id,
|
||||
'bill_time!=' => '0000-00-00 00:00:00', 'UNIX_TIMESTAMP( bill_time ) > c_time' => null,
|
||||
'u_time>=' => $day . ' 00:00:00', 'u_time<=' => $day . ' 23:59:59'
|
||||
];
|
||||
$rows = $receiverOrdersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '开票时间早于订单录入时间';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_ORDER_CTIME) {
|
||||
//昨天开始时间
|
||||
$yesterday = $day . ' 00:00:00';
|
||||
$receiverOrdersModel = new Receiver_orders_model();
|
||||
$where = [
|
||||
'status>=' => 0, 'sale_id' => $uid, 'biz_id' => $biz_id,
|
||||
'c_time>=' => strtotime($day . ' 00:00:00'), 'c_time<=' => strtotime($day . ' 23:59:59'),
|
||||
"customer_id in (select id from lc_receiver_customers where sales_p_time> '{$yesterday}' and biz_id={$biz_id})" => null,
|
||||
];
|
||||
$rows = $receiverOrdersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '线索录入与下单时间间隔少于 T+1';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_VISIT_TIMEOUT) {
|
||||
$mdCustomerVisitData = new receiver_customers_visit_data_model();
|
||||
$where = [
|
||||
"a.biz_id" => $biz_id, "a.cs_biz_id<>" => -1,
|
||||
"a.status in(0,1)" => null, "b.t_day" => $day,
|
||||
"b.status" => 1, "a.admin_id" => $uid
|
||||
];
|
||||
$rows = $mdCustomerVisitData->select_visit($where, 'a.id desc', 1, 100, 'a.id');
|
||||
$desc = '线索逾期未跟进';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_P_TIME_TIMEOUT && $group_id == App_licheb_users_model::GROUP_BIZ) {
|
||||
$receiverCustomersModel = new Receiver_customers_model();
|
||||
$where = [
|
||||
'status>=' => 0, 'rid>' => 0, 'biz_id' => $biz_id,
|
||||
'p_time>=' => $day . ' 00:00:00', 'p_time<=' => $day . ' 23:59:59',
|
||||
'UNIX_TIMESTAMP(p_time)-UNIX_TIMESTAMP(sales_p_time) ' > 600
|
||||
];
|
||||
$rows = $receiverCustomersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '分配时间超过10分钟';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
} elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_TIMEOUT && $group_id == App_licheb_users_model::GROUP_BIZ) {
|
||||
$receiverCustomersModel = new Receiver_customers_model();
|
||||
$where = [
|
||||
'status in (0,1)' => null, 'biz_id' => $biz_id, 'if_defeat' => 1, 'apply_def_time>=' => $day . ' 00:00:00', 'apply_def_time<=' => $day . ' 23:59:59'
|
||||
];
|
||||
$rows = $receiverCustomersModel->select($where, '', 1, 1000, 'id');
|
||||
$desc = '战败申请当日未处理';
|
||||
if ($rows) {
|
||||
foreach ($rows as $val) {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}:" . $val['id'], 2, $val['id']);
|
||||
}
|
||||
} else {
|
||||
Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -6,7 +6,7 @@
|
||||
* Time: 13:47
|
||||
*/
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Area_model extends HD_Model
|
||||
{
|
||||
@@ -17,14 +17,10 @@ class Area_model extends HD_Model
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
public function province($show_limit = false)
|
||||
public function province()
|
||||
{
|
||||
$result = array();
|
||||
$where = [];
|
||||
if($show_limit){
|
||||
$where["province_id in (430000,350000)"] = null;
|
||||
}
|
||||
$list = $this->select($where, null, null, null, 'distinct(province_id), province_name');
|
||||
$list = $this->select(null, null, null, null, 'distinct(province_id), province_name');
|
||||
|
||||
if ($list) {
|
||||
foreach ($list as $v) {
|
||||
|
||||
@@ -7,11 +7,6 @@ class App_licheb_users_model extends HD_Model
|
||||
|
||||
private $group_arr = [1 => '车管家', 2 => '店长', 3 => '投资人', 4 => '客户成功经理'];
|
||||
|
||||
const GROUP_MANAGER = 1; // 车管家
|
||||
const GROUP_BIZ = 2; // 店长
|
||||
const GROUP_INVESTOR = 3; // 投资人
|
||||
const GROUP_CUSTOMER_MANAGER = 4; // 客户成功经理
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class App_paic_users_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_app_paic_users';
|
||||
|
||||
const BELONG_TO_LIST = ['电销', '创展', '寿险'];
|
||||
const STATUS_NORMAL = 0; //状态正常
|
||||
const STATUS_DISABLE = 0; //状态禁用
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
}
|
||||
@@ -47,10 +47,10 @@ class Auto_brand_model extends HD_Model
|
||||
*/
|
||||
public function map_brand($where=array(), $map=true){
|
||||
if ($map){
|
||||
$map_brand = $this->map('id', 'name', $where, 'initial asc', 0 , 0, 'id, name');
|
||||
$map_brand = $this->map('id', 'name', $where, 'status desc, id asc', 0 , 0, 'id, name');
|
||||
}
|
||||
else{
|
||||
$map_brand = $this->select($where, "initial asc", 0, 0, 'id, name');
|
||||
$map_brand = $this->select($where, "status desc, id asc", 0, 0, 'id, name');
|
||||
}
|
||||
return $map_brand;
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Autohome_customer_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_autohome_customers';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
* Time: 13:47
|
||||
*/
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Biz_model extends HD_Model
|
||||
{
|
||||
@@ -63,7 +63,8 @@ class Biz_model extends HD_Model
|
||||
*/
|
||||
function type_ary($key = null)
|
||||
{
|
||||
$map = array('1' => '空间站', '2' => '车卖场', '3' => '准车卖场', '4' => '二网');
|
||||
$map = array('1' => '品牌店', '2' => '合伙店', '3' => '代理店', '4' => '合作店', '5' => '异业店');
|
||||
//$map = array('1' => '品牌店', '2' => '合伙店', '3' => '代理店');
|
||||
if (!is_null($key)) {
|
||||
return $map[$key];
|
||||
}
|
||||
@@ -83,8 +84,8 @@ class Biz_model extends HD_Model
|
||||
$lng = (float)$lng;
|
||||
$where = "status=1 and lat>0 and lng>0";
|
||||
$typeAry = $this->type_ary();
|
||||
$type_ids = implode(',', array_keys($typeAry));
|
||||
$where = $where . " and type in ($type_ids)";
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$where = $where." and type in ($type_ids)";
|
||||
|
||||
if ($page) {
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Biz_report_day_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_biz_report_day';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,9 +27,9 @@ class Receiver_clues_model extends HD_Model
|
||||
public function statusAry($status = '')
|
||||
{
|
||||
$status_ary[0] = array('name' => '待处理', 'list' => array());
|
||||
$status_ary[2] = array('name' => '跟进中', 'list' => array(4 => '未接通', 5 => '待派单', 6 => '待挖掘'));
|
||||
$status_ary[2] = array('name' => '跟进中', 'list' => array(4 => '未接通', 5 => '待派单'));
|
||||
$status_ary[1] = array('name' => '已派单', 'list' => array(1 => '待转交', 2 => '已转交'));
|
||||
$status_ary[3] = array('name' => '无效线索', 'list' => array(6 => '空号', 7 => '已买车', 8 => '无意向', 9 => '非本人'));
|
||||
$status_ary[3] = array('name' => '无效线索', 'list' => array());
|
||||
// $status_ary[1] = array('name' => '已分配', 'list' => array());
|
||||
// $status_ary[2] = array('name' => '跟进中', 'list' => array());
|
||||
// $status_ary[3] = array('name' => '无效线索', 'list' => array(7 => '明确拒绝', 8 => '误报', 9 => '战败'));
|
||||
|
||||
@@ -6,14 +6,12 @@
|
||||
* Time: 13:47
|
||||
*/
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Receiver_customer_oplogs_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_customer_oplogs';
|
||||
|
||||
const SUB_TYPE_XZ = 'xz';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Receiver_score_avg_day_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_score_avg_day';
|
||||
|
||||
// 类型(0个人 1门店)
|
||||
const TYPE_USER = 0;
|
||||
const TYPE_BIZ = 1;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model('biz/biz_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $type int 类型(0个人 1门店)
|
||||
* @param $biz_id int 门店id
|
||||
* @param $limit int 获取条数
|
||||
* @param $day string 排行日期 YYYY-MM
|
||||
* @return array
|
||||
*/
|
||||
public static function getTopLists($type, $biz_id = 0, $limit = 10, $day = '')
|
||||
{
|
||||
!$day && $day = date('Y-m-d');
|
||||
$where = [];
|
||||
$where['day'] = $day;
|
||||
if ($type) {
|
||||
$biz = (new Biz_model())->get(['id' => $biz_id]);
|
||||
$where['province_id'] = $biz['province_id'];
|
||||
$where['type'] = self::TYPE_BIZ;
|
||||
} else {
|
||||
$where['biz_id'] = $biz_id;
|
||||
$where['type'] = self::TYPE_USER;
|
||||
}
|
||||
$lists = [];
|
||||
$rows = (new Receiver_score_avg_day_model)->select($where, 'score desc', 1, $limit);
|
||||
if ($rows) {
|
||||
$userModel = new App_licheb_users_model();
|
||||
$groups = $userModel->get_group();
|
||||
foreach ($rows as $row) {
|
||||
$tip = '';
|
||||
if ($type) {
|
||||
$biz = (new Biz_model())->get(['id' => $row['biz_id']]);
|
||||
$name = $biz['biz_name'] ?: '';
|
||||
} else {
|
||||
$user = $userModel->get(['id' => $row['uid']]);
|
||||
$name = $user['uname'] ?: '';
|
||||
$tip = $groups[$user['group_id']] ?: '';
|
||||
}
|
||||
$lists[] = [
|
||||
'name' => $name,
|
||||
'tip' => $tip,
|
||||
'trend' => $row['change_score'] >= 0 ? 1 : 2, //1 上升 、2 下降
|
||||
'score' => ceil($row['score']) . '分'
|
||||
];
|
||||
}
|
||||
}
|
||||
return ['lists' => $lists, 'day' => $day];
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Receiver_score_config_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_score_config';
|
||||
|
||||
const TYPE_BASE = 0;
|
||||
const TYPE_CLUE = 1;
|
||||
const TYPE_ORDER = 2;
|
||||
const TYPE_DEDUCT = 3;
|
||||
|
||||
const TYPE_LIST = [
|
||||
self::TYPE_BASE => ['name' => '基础分', 'sub_list' => self::TYPE_BASE_LIST],
|
||||
self::TYPE_CLUE => ['name' => '线索分', 'sub_list' => self::TYPE_CLUE_LIST],
|
||||
self::TYPE_ORDER => ['name' => '订单分', 'sub_list' => self::TYPE_ORDER_LIST],
|
||||
self::TYPE_DEDUCT => ['name' => '扣分项', 'sub_list' => self::TYPE_DEDUCT_LIST],
|
||||
];
|
||||
// ==== 基础分子类型 ====
|
||||
const TYPE_BASE_KG = 0;
|
||||
const TYPE_BASE_DEFAULT = 1;
|
||||
// ==== 线索分子类型 ====
|
||||
const TYPE_CLUE_ADD = 0;
|
||||
const TYPE_CLUE_ADD_WX = 1;
|
||||
const TYPE_CLUE_ADD_GJ = 2;
|
||||
const TYPE_CLUE_ADD_TEL = 3;
|
||||
// ==== 订单分子类型 ====
|
||||
const TYPE_ORDER_ADD = 0;
|
||||
const TYPE_ORDER_UPLOAD_DATA = 1;
|
||||
// ==== 扣分项子类型 ====
|
||||
const TYPE_DEDUCT_CLUE_TIMEOUT = 0;
|
||||
const TYPE_DEDUCT_BILL_TIMEOUT = 1;
|
||||
const TYPE_DEDUCT_ORDER_CTIME = 2;
|
||||
const TYPE_DEDUCT_VISIT_TIMEOUT = 3;
|
||||
const TYPE_DEDUCT_P_TIME_TIMEOUT = 4;
|
||||
const TYPE_DEDUCT_TIMEOUT = 5;
|
||||
|
||||
const TYPE_BASE_LIST = [
|
||||
self::TYPE_BASE_KG => '正常开工',
|
||||
self::TYPE_BASE_DEFAULT => '基础分',
|
||||
];
|
||||
const TYPE_CLUE_LIST = [
|
||||
self::TYPE_CLUE_ADD => '新增线索',
|
||||
self::TYPE_CLUE_ADD_WX => '加微信',
|
||||
self::TYPE_CLUE_ADD_GJ => '跟进小记',
|
||||
self::TYPE_CLUE_ADD_TEL => '电话邀约',
|
||||
];
|
||||
const TYPE_ORDER_LIST = [
|
||||
self::TYPE_ORDER_ADD => '新增订单',
|
||||
self::TYPE_ORDER_UPLOAD_DATA => '上传资料',
|
||||
];
|
||||
const TYPE_DEDUCT_LIST = [
|
||||
//车管家
|
||||
self::TYPE_DEDUCT_CLUE_TIMEOUT => '线索跟进时间超过15分钟',
|
||||
self::TYPE_DEDUCT_BILL_TIMEOUT => '开票时间早于订单录入时间',
|
||||
self::TYPE_DEDUCT_ORDER_CTIME => '线索录入与下单时间间隔少于 T+1',
|
||||
self::TYPE_DEDUCT_VISIT_TIMEOUT => '线索逾期未跟进',
|
||||
//店长
|
||||
self::TYPE_DEDUCT_P_TIME_TIMEOUT => '分配时间超过10分钟',
|
||||
self::TYPE_DEDUCT_TIMEOUT => '战败申请当日未处理'
|
||||
];
|
||||
|
||||
const STATUS_NORMAL = 1; //正常状态
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Receiver_score_day_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_score_day';
|
||||
|
||||
// 类型(0个人 1门店)
|
||||
const TYPE_USER = 0;
|
||||
const TYPE_BIZ = 1;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model('biz/biz_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $type int 类型(0个人 1门店)
|
||||
* @param $biz_id int 门店id
|
||||
* @param $limit int 获取条数
|
||||
* @param $day string 排行日期 YYYY-MM-DD
|
||||
* @return array
|
||||
*/
|
||||
public static function getTopLists($type, $biz_id = 0, $limit = 10, $day = '')
|
||||
{
|
||||
!$day && $day = date('Y-m-d', strtotime("-1 day"));
|
||||
$where = [];
|
||||
$where['day'] = $day;
|
||||
if ($type) {
|
||||
$biz = (new Biz_model())->get(['id' => $biz_id]);
|
||||
$where['province_id'] = $biz['province_id'];
|
||||
$where['type'] = self::TYPE_BIZ;
|
||||
} else {
|
||||
$where['biz_id'] = $biz_id;
|
||||
$where['type'] = self::TYPE_USER;
|
||||
}
|
||||
$lists = [];
|
||||
$rows = (new Receiver_score_day_model)->select($where, 'score desc', 1, $limit);
|
||||
if ($rows) {
|
||||
$userModel = new App_licheb_users_model();
|
||||
$groups = $userModel->get_group();
|
||||
foreach ($rows as $row) {
|
||||
$tip = '';
|
||||
if ($type) {
|
||||
$biz = (new Biz_model())->get(['id' => $row['biz_id']]);
|
||||
$name = $biz['biz_name'] ?: '';
|
||||
} else {
|
||||
$user = $userModel->get(['id' => $row['uid']]);
|
||||
$name = $user['uname'] ?: '';
|
||||
$tip = $groups[$user['group_id']] ?: '';
|
||||
}
|
||||
$lists[] = [
|
||||
'name' => $name,
|
||||
'tip' => $tip,
|
||||
'trend' => $row['change_score'] >= 0 ? 1 : 2, //1 上升 、2 下降
|
||||
'score' => ceil($row['score']) . '分'
|
||||
];
|
||||
}
|
||||
}
|
||||
return ['lists' => $lists, 'day' => $day];
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Receiver_score_log_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_score_log';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
$this->load->model('receiver/receiver_score_config_model');
|
||||
}
|
||||
|
||||
public static function getUserLogLists($biz_id, $uid, $day, $type = '')
|
||||
{
|
||||
$where = [
|
||||
'biz_id' => $biz_id,
|
||||
'uid' => $uid,
|
||||
'day' => $day,
|
||||
];
|
||||
if (is_numeric($type)) {
|
||||
$where['type'] = $type;
|
||||
}
|
||||
$rows = (new Receiver_score_log_model)->select_groupby('sub_type', $where, '', 1, 50, 'id,uid,type,sub_type,sum(score) as score');
|
||||
$lists = [];
|
||||
if ($rows) {
|
||||
foreach ($rows as $item) {
|
||||
$sub_type = Receiver_score_config_model::TYPE_LIST[$item['type']]['sub_list'];
|
||||
$name = $sub_type[$item['sub_type']] ?: '';
|
||||
$lists[] = [
|
||||
'name' => $name,
|
||||
'score' => ceil($item['score']),
|
||||
];
|
||||
}
|
||||
}
|
||||
return $lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分数日志
|
||||
* @param $uid
|
||||
* @param $biz_id
|
||||
* @param $day
|
||||
* @param $type
|
||||
* @param $sub_type
|
||||
* @param $desc
|
||||
* @param $limit_type 0不限制 1每天限制对应target_id增加一次 2永久限制添加一次
|
||||
* @param $target_id
|
||||
* @param $score
|
||||
* @return false|mixed
|
||||
*/
|
||||
public static function add_score($uid, $biz_id, $day, $type, $sub_type, $desc = '', $limit_type = 0, $target_id = 0, $score = '')
|
||||
{
|
||||
$scoreLogModel = new Receiver_score_log_model();
|
||||
if (!is_numeric($score)) {
|
||||
$scoreConfigModel = new Receiver_score_config_model();
|
||||
$where = ['type' => $type, 'sub_type' => $sub_type, 'status' => Receiver_score_config_model::STATUS_NORMAL];
|
||||
$configRow = $scoreConfigModel->get($where);
|
||||
$score = $configRow['score'] ?: 0;
|
||||
}
|
||||
$isExit = false;
|
||||
if ($limit_type) {
|
||||
$where = [
|
||||
'type' => $type,
|
||||
'sub_type' => $sub_type,
|
||||
'uid' => $uid,
|
||||
'biz_id' => $biz_id
|
||||
];
|
||||
if ($limit_type == 1) {
|
||||
$where['day'] = $day;
|
||||
}
|
||||
$target_id && $where['target_id'] = $target_id;
|
||||
$isExit = $scoreLogModel->get($where);
|
||||
}
|
||||
if ($isExit) {
|
||||
return false;
|
||||
}
|
||||
$add_data = [
|
||||
'biz_id' => $biz_id,
|
||||
'uid' => $uid,
|
||||
'day' => $day,
|
||||
'type' => $type,
|
||||
'sub_type' => $sub_type,
|
||||
'score' => $score,
|
||||
'c_time' => time(),
|
||||
];
|
||||
$target_id && $add_data['target_id'] = $target_id;
|
||||
$desc && $add_data['desc'] = $desc;
|
||||
return $scoreLogModel->add($add_data);
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Receiver_score_month_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_score_month';
|
||||
// 类型(0个人 1门店)
|
||||
const TYPE_USER = 0;
|
||||
const TYPE_BIZ = 1;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $type int 类型(0个人 1门店)
|
||||
* @param $biz_id int 门店id
|
||||
* @param $limit int 获取条数
|
||||
* @param $day string 排行日期 YYYY-MM
|
||||
* @return array
|
||||
*/
|
||||
public static function getTopLists($type, $biz_id = 0, $limit = 10, $day = '')
|
||||
{
|
||||
!$day && $day = date('Y-m', strtotime("-1 month"));
|
||||
$where = [];
|
||||
$where['year'] = date('Y', strtotime($day));;
|
||||
$where['month'] = date('m', strtotime($day));;
|
||||
if ($type) {
|
||||
$biz = (new Biz_model())->get(['id' => $biz_id]);
|
||||
$where['province_id'] = $biz['province_id'];
|
||||
$where['type'] = self::TYPE_BIZ;
|
||||
} else {
|
||||
$where['biz_id'] = $biz_id;
|
||||
$where['type'] = self::TYPE_USER;
|
||||
}
|
||||
$lists = [];
|
||||
$rows = (new Receiver_score_month_model)->select($where, 'score desc', 1, $limit);
|
||||
if ($rows) {
|
||||
$userModel = new App_licheb_users_model();
|
||||
$groups = $userModel->get_group();
|
||||
foreach ($rows as $row) {
|
||||
$tip = '';
|
||||
if ($type) {
|
||||
$biz = (new Biz_model())->get(['id' => $row['biz_id']]);
|
||||
$name = $biz['biz_name'] ?: '';
|
||||
} else {
|
||||
$user = $userModel->get(['id' => $row['uid']]);
|
||||
$name = $user['uname'] ?: '';
|
||||
$tip = $groups[$user['group_id']] ?: '';
|
||||
}
|
||||
$lists[] = [
|
||||
'name' => $name,
|
||||
'tip' => $tip,
|
||||
'trend' => $row['change_score'] >= 0 ? 1 : 2, //1 上升 、2 下降
|
||||
'score' => ceil($row['score']) . '分'
|
||||
];
|
||||
}
|
||||
}
|
||||
return ['lists' => $lists, 'day' => $day];
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Notes:晓致虚拟号通话记录
|
||||
* Created on: 2021/7/26 13:38
|
||||
* Created by: dengbw
|
||||
*/
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Receiver_xz_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_xz';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
//获取晓致状态
|
||||
public function get_xz_status($status=''){
|
||||
$arr = [
|
||||
-1 => '实时来电通知(是否接听状态未知,非话单记录)',
|
||||
0 => '正常接听',
|
||||
1 => '未应答',
|
||||
2 => '黑名单来电,拒接',
|
||||
3 => '虚号关机状态,未接听',
|
||||
4 => '未绑定号码',
|
||||
5 => '遇忙未接听'
|
||||
];
|
||||
if(strlen($status)){
|
||||
return $arr[$status] ? $arr[$status] : '未知状态';
|
||||
}else{
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
||||
//获取晓致noAnswerReaso对应错误码
|
||||
public function get_xz_noAnswerReason($noAnswerReason=''){
|
||||
$arr = [
|
||||
11 => '主叫挂机',
|
||||
12 => '被叫挂机',
|
||||
13 => '被叫正在通话中',
|
||||
14 => '被叫无人接听',
|
||||
15 => '被叫无法接通',
|
||||
16 => '被叫关机',
|
||||
17 => '被叫空号',
|
||||
18 => '被叫暂停服务',
|
||||
19 => '被叫转接失败',
|
||||
];
|
||||
if(strlen($noAnswerReason)){
|
||||
return $arr[$noAnswerReason] ? $arr[$noAnswerReason] : '';
|
||||
}else{
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Receiver_order_oplogs_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_order_oplogs';
|
||||
|
||||
const TYPE_LIST = [
|
||||
0 => '小记',
|
||||
1 => '上传图片'
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
|
||||
@@ -7,20 +7,9 @@ class Receiver_orders_model extends HD_Model
|
||||
|
||||
private $status_arr = [0 => '签约下定', 1 => '发票开具', 2 => '车辆交付', 3 => '已完成'];
|
||||
|
||||
const CPS_TYPE_OTHER = 0; //其它车型
|
||||
const CPS_TYPE_IMPORTANT = 1; //重点品牌
|
||||
const CPS_TYPE_NORMAl = 2; //常规品牌
|
||||
|
||||
const CPS_TYPES = [
|
||||
self::CPS_TYPE_OTHER => '其它品牌',
|
||||
self::CPS_TYPE_IMPORTANT => '重点品牌',
|
||||
self::CPS_TYPE_NORMAl => '常规品牌',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
$this->load->model("sys/sys_cps_model");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,28 +35,4 @@ class Receiver_orders_model extends HD_Model
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $brand_id
|
||||
* @param $time
|
||||
* @return int
|
||||
*/
|
||||
public function get_cps_type($brand_id, $time = 0)
|
||||
{
|
||||
$cps_type = self::CPS_TYPE_OTHER;
|
||||
!$time && $time = time();
|
||||
if ($brand_id) {
|
||||
$where = [
|
||||
'brand_id' => $brand_id,
|
||||
's_time<=' => date('Y-m-d', $time),
|
||||
'e_time>=' => date('Y-m-d', $time),
|
||||
'status' => Sys_cps_model::STATUS_NORMAL,
|
||||
];
|
||||
$row = $this->sys_cps_model->get($where);
|
||||
if ($row) {
|
||||
$cps_type = $row['type'];
|
||||
}
|
||||
}
|
||||
return $cps_type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Sys_cps_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_sys_cps';
|
||||
const TYPE_IMPORTANT = 1; //重点品牌
|
||||
const TYPE_NORMAL = 2; //常规品牌
|
||||
|
||||
const TYPES = [
|
||||
self::TYPE_IMPORTANT => '重点品牌',
|
||||
self::TYPE_NORMAL => '常规品牌',
|
||||
];
|
||||
|
||||
const STATUS_DISABLE = 0; //禁用
|
||||
const STATUS_NORMAL = 1; //正常
|
||||
|
||||
const STATUS_LISTS = [
|
||||
self::STATUS_DISABLE => '禁用',
|
||||
self::STATUS_NORMAL => '正常',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Sys_yx_mobiles_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_sys_yx_mobiles';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
}
|
||||
Vendored
+2
-2
@@ -8,8 +8,8 @@
|
||||
|
||||
class Xcall{
|
||||
|
||||
private $id = 1428;
|
||||
private $key = 'S3WMWHBGKSDZP5SYYVDV4JZK';
|
||||
private $id = '1206';
|
||||
private $key = 'WX6HDVZX3AYSZDR1739332ZM';
|
||||
private $api_url = 'http://api.teleii.com/';
|
||||
private $ci;
|
||||
private $log_file = 'xcall.log';
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<IfModule authz_core_module>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !authz_core_module>
|
||||
Deny from all
|
||||
</IfModule>
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,135 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| AUTO-LOADER
|
||||
| -------------------------------------------------------------------
|
||||
| This file specifies which systems should be loaded by default.
|
||||
|
|
||||
| In order to keep the framework as light-weight as possible only the
|
||||
| absolute minimal resources are loaded by default. For example,
|
||||
| the database is not connected to automatically since no assumption
|
||||
| is made regarding whether you intend to use it. This file lets
|
||||
| you globally define which systems you would like loaded with every
|
||||
| request.
|
||||
|
|
||||
| -------------------------------------------------------------------
|
||||
| Instructions
|
||||
| -------------------------------------------------------------------
|
||||
|
|
||||
| These are the things you can load automatically:
|
||||
|
|
||||
| 1. Packages
|
||||
| 2. Libraries
|
||||
| 3. Drivers
|
||||
| 4. Helper files
|
||||
| 5. Custom config files
|
||||
| 6. Language files
|
||||
| 7. Models
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Packages
|
||||
| -------------------------------------------------------------------
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
||||
|
|
||||
*/
|
||||
$autoload['packages'] = array();
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Libraries
|
||||
| -------------------------------------------------------------------
|
||||
| These are the classes located in system/libraries/ or your
|
||||
| application/libraries/ directory, with the addition of the
|
||||
| 'database' library, which is somewhat of a special case.
|
||||
|
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['libraries'] = array('database', 'email', 'session');
|
||||
|
|
||||
| You can also supply an alternative library name to be assigned
|
||||
| in the controller:
|
||||
|
|
||||
| $autoload['libraries'] = array('user_agent' => 'ua');
|
||||
*/
|
||||
$autoload['libraries'] = array('database');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Drivers
|
||||
| -------------------------------------------------------------------
|
||||
| These classes are located in system/libraries/ or in your
|
||||
| application/libraries/ directory, but are also placed inside their
|
||||
| own subdirectory and they extend the CI_Driver_Library class. They
|
||||
| offer multiple interchangeable driver options.
|
||||
|
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['drivers'] = array('cache');
|
||||
|
|
||||
| You can also supply an alternative property name to be assigned in
|
||||
| the controller:
|
||||
|
|
||||
| $autoload['drivers'] = array('cache' => 'cch');
|
||||
|
|
||||
*/
|
||||
$autoload['drivers'] = array();
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Helper Files
|
||||
| -------------------------------------------------------------------
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['helper'] = array('url', 'file');
|
||||
*/
|
||||
$autoload['helper'] = array('comm', 'url', 'array','order');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Config files
|
||||
| -------------------------------------------------------------------
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['config'] = array('config1', 'config2');
|
||||
|
|
||||
| NOTE: This item is intended for use ONLY if you have created custom
|
||||
| config files. Otherwise, leave it blank.
|
||||
|
|
||||
*/
|
||||
$autoload['config'] = array();
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Language files
|
||||
| -------------------------------------------------------------------
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['language'] = array('lang1', 'lang2');
|
||||
|
|
||||
| NOTE: Do not include the "_lang" part of your file. For example
|
||||
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
||||
|
|
||||
*/
|
||||
$autoload['language'] = array();
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Auto-load Models
|
||||
| -------------------------------------------------------------------
|
||||
| Prototype:
|
||||
|
|
||||
| $autoload['model'] = array('first_model', 'second_model');
|
||||
|
|
||||
| You can also supply an alternative model name to be assigned
|
||||
| in the controller:
|
||||
|
|
||||
| $autoload['model'] = array('first_model' => 'first');
|
||||
*/
|
||||
$autoload['model'] = array();
|
||||
@@ -1,523 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Base Site URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| URL to your CodeIgniter root. Typically this will be your base URL,
|
||||
| WITH a trailing slash:
|
||||
|
|
||||
| http://example.com/
|
||||
|
|
||||
| WARNING: You MUST set this value!
|
||||
|
|
||||
| If it is not set, then CodeIgniter will try guess the protocol and path
|
||||
| your installation, but due to security concerns the hostname will be set
|
||||
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
|
||||
| The auto-detection mechanism exists only for convenience during
|
||||
| development and MUST NOT be used in production!
|
||||
|
|
||||
| If you need to allow multiple domains, remember that this file is still
|
||||
| a PHP script and you can easily do that on your own.
|
||||
|
|
||||
*/
|
||||
$config['base_url'] = 'https://liche-api-dev.xiaoyu.com/';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Index File
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Typically this will be your index.php file, unless you've renamed it to
|
||||
| something else. If you are using mod_rewrite to remove the page set this
|
||||
| variable so that it is blank.
|
||||
|
|
||||
*/
|
||||
$config['index_page'] = 'index.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| URI PROTOCOL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This item determines which server global should be used to retrieve the
|
||||
| URI string. The default setting of 'REQUEST_URI' works for most servers.
|
||||
| If your links do not seem to work, try one of the other delicious flavors:
|
||||
|
|
||||
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
|
||||
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
|
||||
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
||||
|
|
||||
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
|
||||
*/
|
||||
$config['uri_protocol'] = 'REQUEST_URI';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| URL suffix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
|
||||
| For more information please see the user guide:
|
||||
|
|
||||
| https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
$config['url_suffix'] = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Language
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This determines which set of language files should be used. Make sure
|
||||
| there is an available translation if you intend to use something other
|
||||
| than english.
|
||||
|
|
||||
*/
|
||||
$config['language'] = 'english';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Character Set
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This determines which character set is used by default in various methods
|
||||
| that require a character set to be provided.
|
||||
|
|
||||
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
||||
|
|
||||
*/
|
||||
$config['charset'] = 'UTF-8';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable/Disable System Hooks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you would like to use the 'hooks' feature you must enable it by
|
||||
| setting this variable to TRUE (boolean). See the user guide for details.
|
||||
|
|
||||
*/
|
||||
$config['enable_hooks'] = TRUE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Extension Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This item allows you to set the filename/classname prefix when extending
|
||||
| native libraries. For more information please see the user guide:
|
||||
|
|
||||
| https://codeigniter.com/user_guide/general/core_classes.html
|
||||
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
||||
|
|
||||
*/
|
||||
$config['subclass_prefix'] = 'HD_';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Composer auto-loading
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enabling this setting will tell CodeIgniter to look for a Composer
|
||||
| package auto-loader script in application/vendor/autoload.php.
|
||||
|
|
||||
| $config['composer_autoload'] = TRUE;
|
||||
|
|
||||
| Or if you have your vendor/ directory located somewhere else, you
|
||||
| can opt to set a specific path as well:
|
||||
|
|
||||
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
||||
|
|
||||
| For more information about Composer, please visit http://getcomposer.org/
|
||||
|
|
||||
| Note: This will NOT disable or override the CodeIgniter-specific
|
||||
| autoloading (application/config/autoload.php)
|
||||
*/
|
||||
$config['composer_autoload'] = COMMPATH.'/vendor/autoload.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allowed URL Characters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This lets you specify which characters are permitted within your URLs.
|
||||
| When someone tries to submit a URL with disallowed characters they will
|
||||
| get a warning message.
|
||||
|
|
||||
| As a security measure you are STRONGLY encouraged to restrict URLs to
|
||||
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
||||
|
|
||||
| Leave blank to allow all characters -- but only if you are insane.
|
||||
|
|
||||
| The configured value is actually a regular expression character group
|
||||
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
||||
|
|
||||
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
||||
|
|
||||
*/
|
||||
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable Query Strings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default CodeIgniter uses search-engine friendly segment based URLs:
|
||||
| example.com/who/what/where/
|
||||
|
|
||||
| You can optionally enable standard query string based URLs:
|
||||
| example.com?who=me&what=something&where=here
|
||||
|
|
||||
| Options are: TRUE or FALSE (boolean)
|
||||
|
|
||||
| The other items let you set the query string 'words' that will
|
||||
| invoke your controllers and its functions:
|
||||
| example.com/index.php?c=controller&m=function
|
||||
|
|
||||
| Please note that some of the helpers won't work as expected when
|
||||
| this feature is enabled, since CodeIgniter is designed primarily to
|
||||
| use segment based URLs.
|
||||
|
|
||||
*/
|
||||
$config['enable_query_strings'] = FALSE;
|
||||
$config['controller_trigger'] = 'c';
|
||||
$config['function_trigger'] = 'm';
|
||||
$config['directory_trigger'] = 'd';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allow $_GET array
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default CodeIgniter enables access to the $_GET array. If for some
|
||||
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
||||
|
|
||||
| WARNING: This feature is DEPRECATED and currently available only
|
||||
| for backwards compatibility purposes!
|
||||
|
|
||||
*/
|
||||
$config['allow_get_array'] = TRUE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Logging Threshold
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can enable error logging by setting a threshold over zero. The
|
||||
| threshold determines what gets logged. Threshold options are:
|
||||
|
|
||||
| 0 = Disables logging, Error logging TURNED OFF
|
||||
| 1 = Error Messages (including PHP errors)
|
||||
| 2 = Debug Messages
|
||||
| 3 = Informational Messages
|
||||
| 4 = All Messages
|
||||
|
|
||||
| You can also pass an array with threshold levels to show individual error types
|
||||
|
|
||||
| array(2) = Debug Messages, without Error Messages
|
||||
|
|
||||
| For a live site you'll usually only enable Errors (1) to be logged otherwise
|
||||
| your log files will fill up very fast.
|
||||
|
|
||||
*/
|
||||
$config['log_threshold'] = 1;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Logging Directory Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Leave this BLANK unless you would like to set something other than the default
|
||||
| application/logs/ directory. Use a full server path with trailing slash.
|
||||
|
|
||||
*/
|
||||
$config['log_path'] = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log File Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The default filename extension for log files. The default 'php' allows for
|
||||
| protecting the log files via basic scripting, when they are to be stored
|
||||
| under a publicly accessible directory.
|
||||
|
|
||||
| Note: Leaving it blank will default to 'php'.
|
||||
|
|
||||
*/
|
||||
$config['log_file_extension'] = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log File Permissions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The file system permissions to be applied on newly created log files.
|
||||
|
|
||||
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
|
||||
| integer notation (i.e. 0700, 0644, etc.)
|
||||
*/
|
||||
$config['log_file_permissions'] = 0644;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Date Format for Logs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Each item that is logged has an associated date. You can use PHP date
|
||||
| codes to set your own date formatting
|
||||
|
|
||||
*/
|
||||
$config['log_date_format'] = 'Y-m-d H:i:s';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Views Directory Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Leave this BLANK unless you would like to set something other than the default
|
||||
| application/views/errors/ directory. Use a full server path with trailing slash.
|
||||
|
|
||||
*/
|
||||
$config['error_views_path'] = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Directory Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Leave this BLANK unless you would like to set something other than the default
|
||||
| application/cache/ directory. Use a full server path with trailing slash.
|
||||
|
|
||||
*/
|
||||
$config['cache_path'] = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Include Query String
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to take the URL query string into consideration when generating
|
||||
| output cache files. Valid options are:
|
||||
|
|
||||
| FALSE = Disabled
|
||||
| TRUE = Enabled, take all query parameters into account.
|
||||
| Please be aware that this may result in numerous cache
|
||||
| files generated for the same page over and over again.
|
||||
| array('q') = Enabled, but only take into account the specified list
|
||||
| of query parameters.
|
||||
|
|
||||
*/
|
||||
$config['cache_query_string'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you use the Encryption class, you must set an encryption key.
|
||||
| See the user guide for more info.
|
||||
|
|
||||
| https://codeigniter.com/user_guide/libraries/encryption.html
|
||||
|
|
||||
*/
|
||||
$config['encryption_key'] = 'haodian.ai';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| 'sess_driver'
|
||||
|
|
||||
| The storage driver to use: files, database, redis, memcached
|
||||
|
|
||||
| 'sess_cookie_name'
|
||||
|
|
||||
| The session cookie name, must contain only [0-9a-z_-] characters
|
||||
|
|
||||
| 'sess_expiration'
|
||||
|
|
||||
| The number of SECONDS you want the session to last.
|
||||
| Setting to 0 (zero) means expire when the browser is closed.
|
||||
|
|
||||
| 'sess_save_path'
|
||||
|
|
||||
| The location to save sessions to, driver dependent.
|
||||
|
|
||||
| For the 'files' driver, it's a path to a writable directory.
|
||||
| WARNING: Only absolute paths are supported!
|
||||
|
|
||||
| For the 'database' driver, it's a table name.
|
||||
| Please read up the manual for the format with other session drivers.
|
||||
|
|
||||
| IMPORTANT: You are REQUIRED to set a valid save path!
|
||||
|
|
||||
| 'sess_match_ip'
|
||||
|
|
||||
| Whether to match the user's IP address when reading the session data.
|
||||
|
|
||||
| WARNING: If you're using the database driver, don't forget to update
|
||||
| your session table's PRIMARY KEY when changing this setting.
|
||||
|
|
||||
| 'sess_time_to_update'
|
||||
|
|
||||
| How many seconds between CI regenerating the session ID.
|
||||
|
|
||||
| 'sess_regenerate_destroy'
|
||||
|
|
||||
| Whether to destroy session data associated with the old session ID
|
||||
| when auto-regenerating the session ID. When set to FALSE, the data
|
||||
| will be later deleted by the garbage collector.
|
||||
|
|
||||
| Other session cookie settings are shared with the rest of the application,
|
||||
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
||||
|
|
||||
*/
|
||||
$config['sess_driver'] = 'files';
|
||||
$config['sess_cookie_name'] = 'ci_session';
|
||||
$config['sess_expiration'] = 7200;
|
||||
$config['sess_save_path'] = NULL;
|
||||
$config['sess_match_ip'] = FALSE;
|
||||
$config['sess_time_to_update'] = 300;
|
||||
$config['sess_regenerate_destroy'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookie Related Variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
|
||||
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
|
||||
| 'cookie_path' = Typically will be a forward slash
|
||||
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
|
||||
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
||||
|
|
||||
| Note: These settings (with the exception of 'cookie_prefix' and
|
||||
| 'cookie_httponly') will also affect sessions.
|
||||
|
|
||||
*/
|
||||
$config['cookie_prefix'] = '';
|
||||
$config['cookie_domain'] = '';
|
||||
$config['cookie_path'] = '/';
|
||||
$config['cookie_secure'] = FALSE;
|
||||
$config['cookie_httponly'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Standardize newlines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Determines whether to standardize newline characters in input data,
|
||||
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
||||
|
|
||||
| WARNING: This feature is DEPRECATED and currently available only
|
||||
| for backwards compatibility purposes!
|
||||
|
|
||||
*/
|
||||
$config['standardize_newlines'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global XSS Filtering
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Determines whether the XSS filter is always active when GET, POST or
|
||||
| COOKIE data is encountered
|
||||
|
|
||||
| WARNING: This feature is DEPRECATED and currently available only
|
||||
| for backwards compatibility purposes!
|
||||
|
|
||||
*/
|
||||
$config['global_xss_filtering'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cross Site Request Forgery
|
||||
|--------------------------------------------------------------------------
|
||||
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
|
||||
| checked on a submitted form. If you are accepting user data, it is strongly
|
||||
| recommended CSRF protection be enabled.
|
||||
|
|
||||
| 'csrf_token_name' = The token name
|
||||
| 'csrf_cookie_name' = The cookie name
|
||||
| 'csrf_expire' = The number in seconds the token should expire.
|
||||
| 'csrf_regenerate' = Regenerate token on every submission
|
||||
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
|
||||
*/
|
||||
$config['csrf_protection'] = FALSE;
|
||||
$config['csrf_token_name'] = 'csrf_test_name';
|
||||
$config['csrf_cookie_name'] = 'csrf_cookie_name';
|
||||
$config['csrf_expire'] = 7200;
|
||||
$config['csrf_regenerate'] = TRUE;
|
||||
$config['csrf_exclude_uris'] = array();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Output Compression
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enables Gzip output compression for faster page loads. When enabled,
|
||||
| the output class will test whether your server supports Gzip.
|
||||
| Even if it does, however, not all browsers support compression
|
||||
| so enable only if you are reasonably sure your visitors can handle it.
|
||||
|
|
||||
| Only used if zlib.output_compression is turned off in your php.ini.
|
||||
| Please do not use it together with httpd-level output compression.
|
||||
|
|
||||
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
|
||||
| means you are prematurely outputting something to your browser. It could
|
||||
| even be a line of whitespace at the end of one of your scripts. For
|
||||
| compression to work, nothing can be sent before the output buffer is called
|
||||
| by the output class. Do not 'echo' any values with compression enabled.
|
||||
|
|
||||
*/
|
||||
$config['compress_output'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Master Time Reference
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Options are 'local' or any PHP supported timezone. This preference tells
|
||||
| the system whether to use your server's local time as the master 'now'
|
||||
| reference, or convert it to the configured one timezone. See the 'date
|
||||
| helper' page of the user guide for information regarding date handling.
|
||||
|
|
||||
*/
|
||||
$config['time_reference'] = 'local';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Rewrite PHP Short Tags
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your PHP installation does not have short tag support enabled CI
|
||||
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
|
||||
| in your view files. Options are TRUE or FALSE (boolean)
|
||||
|
|
||||
| Note: You need to have eval() enabled for this to work.
|
||||
|
|
||||
*/
|
||||
$config['rewrite_short_tags'] = FALSE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Reverse Proxy IPs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your server is behind a reverse proxy, you must whitelist the proxy
|
||||
| IP addresses from which CodeIgniter should trust headers such as
|
||||
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
|
||||
| the visitor's IP address.
|
||||
|
|
||||
| You can use both an array or a comma-separated list of proxy addresses,
|
||||
| as well as specifying whole subnets. Here are a few examples:
|
||||
|
|
||||
| Comma-separated: '10.0.1.200,192.168.5.0/24'
|
||||
| Array: array('10.0.1.200', '192.168.5.0/24')
|
||||
*/
|
||||
$config['proxy_ips'] = '';
|
||||
@@ -1,109 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Display Debug backtrace
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If set to TRUE, a backtrace will be displayed along with php errors. If
|
||||
| error_reporting is disabled, the backtrace will not display, regardless
|
||||
| of this setting
|
||||
|
|
||||
*/
|
||||
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| File and Directory Modes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These prefs are used when checking and setting modes when working
|
||||
| with the file system. The defaults are fine on servers with proper
|
||||
| security, but you may wish (or even need) to change the values in
|
||||
| certain environments (Apache running a separate process for each
|
||||
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
|
||||
| always be used to set the mode correctly.
|
||||
|
|
||||
*/
|
||||
defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
|
||||
defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
|
||||
defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
|
||||
defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| File Stream Modes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These modes are used when working with fopen()/popen()
|
||||
|
|
||||
*/
|
||||
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
|
||||
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
|
||||
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
|
||||
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
|
||||
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
|
||||
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
|
||||
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
|
||||
defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Exit Status Codes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Used to indicate the conditions under which the script is exit()ing.
|
||||
| While there is no universal standard for error codes, there are some
|
||||
| broad conventions. Three such conventions are mentioned below, for
|
||||
| those who wish to make use of them. The CodeIgniter defaults were
|
||||
| chosen for the least overlap with these conventions, while still
|
||||
| leaving room for others to be defined in future versions and user
|
||||
| applications.
|
||||
|
|
||||
| The three main conventions used for determining exit status codes
|
||||
| are as follows:
|
||||
|
|
||||
| Standard C/C++ Library (stdlibc):
|
||||
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
|
||||
| (This link also contains other GNU-specific conventions)
|
||||
| BSD sysexits.h:
|
||||
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
|
||||
| Bash scripting:
|
||||
| http://tldp.org/LDP/abs/html/exitcodes.html
|
||||
|
|
||||
*/
|
||||
defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
|
||||
defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
|
||||
defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
|
||||
defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
|
||||
defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
|
||||
defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
|
||||
defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
|
||||
defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
|
||||
defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
|
||||
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
|
||||
|
||||
define('ERR_SYS_SUCCESS',0);
|
||||
define('ERR_SYS_FAIL', 9999);
|
||||
define('ERR_SYS_INVAL_PARAM', 9998);
|
||||
define('ERR_USER_NOT_LOGIN', 1001);
|
||||
|
||||
/*edit by xuxianbin 这边应该是多写了一个*/
|
||||
//define('ERR_USER_NOT_LOGIN', 1001);
|
||||
/*edit end*/
|
||||
define('ERR_USER_LOGIN_FAIL', 1002);
|
||||
define('ERR_ACCOUNT_NOT_EXISTS', 1021);
|
||||
define('ERR_PARAMS_ERROR', 1017);
|
||||
|
||||
define('TEMP_PATH', APPPATH.'../www/api/wx/');
|
||||
|
||||
//新的api接口code规定
|
||||
defined('API_CODE_SUCCESS') OR define('API_CODE_SUCCESS', 200);//成功
|
||||
defined('API_CODE_FAIL') OR define('API_CODE_FAIL', 400);//请求失败
|
||||
defined('API_CODE_NONE') OR define('API_CODE_FORB', 403);//禁止访问
|
||||
defined('API_CODE_NONE') OR define('API_CODE_NONE', 404);//页面不存在
|
||||
defined('API_CODE_LOGOUT') OR define('API_CODE_LOGOUT', 408);//未登录
|
||||
defined('API_CODE_INVILD_PARAM') OR define('API_CODE_INVILD_PARAM', 401);//非法参数
|
||||
defined('API_CODE_USER_FULL') OR define('API_CODE_USER_FULL', 417);//完善用户资料
|
||||
defined('API_CODE_ORC_FAIL') OR define('API_CODE_ORC_FAIL', 418);//图片识别失败
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| DATABASE CONNECTIVITY SETTINGS
|
||||
| -------------------------------------------------------------------
|
||||
| This file will contain the settings needed to access your database.
|
||||
|
|
||||
| For complete instructions please consult the 'Database Connection'
|
||||
| page of the User Guide.
|
||||
|
|
||||
| -------------------------------------------------------------------
|
||||
| EXPLANATION OF VARIABLES
|
||||
| -------------------------------------------------------------------
|
||||
|
|
||||
| ['dsn'] The full DSN string describe a connection to the database.
|
||||
| ['hostname'] The hostname of your database server.
|
||||
| ['username'] The username used to connect to the database
|
||||
| ['password'] The password used to connect to the database
|
||||
| ['database'] The name of the database you want to connect to
|
||||
| ['dbdriver'] The database driver. e.g.: mysqli.
|
||||
| Currently supported:
|
||||
| cubrid, ibase, mssql, mysql, mysqli, oci8,
|
||||
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
|
||||
| ['dbprefix'] You can add an optional prefix, which will be added
|
||||
| to the table name when using the Query Builder class
|
||||
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
|
||||
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
|
||||
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
|
||||
| ['cachedir'] The path to the folder where cache files should be stored
|
||||
| ['char_set'] The character set used in communicating with the database
|
||||
| ['dbcollat'] The character collation used in communicating with the database
|
||||
| NOTE: For MySQL and MySQLi databases, this setting is only used
|
||||
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
|
||||
| (and in table creation queries made with DB Forge).
|
||||
| There is an incompatibility in PHP with mysql_real_escape_string() which
|
||||
| can make your site vulnerable to SQL injection if you are using a
|
||||
| multi-byte character set and are running versions lower than these.
|
||||
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
|
||||
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
|
||||
| ['encrypt'] Whether or not to use an encrypted connection.
|
||||
|
|
||||
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
|
||||
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
||||
|
|
||||
| 'ssl_key' - Path to the private key file
|
||||
| 'ssl_cert' - Path to the public key certificate file
|
||||
| 'ssl_ca' - Path to the certificate authority file
|
||||
| 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
|
||||
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
|
||||
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
||||
|
|
||||
| ['compress'] Whether or not to use client compression (MySQL only)
|
||||
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
|
||||
| - good for ensuring strict SQL while developing
|
||||
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
|
||||
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
|
||||
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
|
||||
| NOTE: Disabling this will also effectively disable both
|
||||
| $this->db->last_query() and profiling of DB queries.
|
||||
| When you run a query, with this setting set to TRUE (default),
|
||||
| CodeIgniter will store the SQL statement for debugging purposes.
|
||||
| However, this may cause high memory usage, especially if you run
|
||||
| a lot of SQL queries ... disable this to avoid that problem.
|
||||
|
|
||||
| The $active_group variable lets you choose which connection group to
|
||||
| make active. By default there is only one group (the 'default' group).
|
||||
|
|
||||
| The $query_builder variables lets you determine whether or not to load
|
||||
| the query builder class.
|
||||
*/
|
||||
$active_group = 'default';
|
||||
$query_builder = TRUE;
|
||||
|
||||
$db['default'] = array(
|
||||
'dsn' => '',
|
||||
'hostname' => 'mysql:host=127.0.0.1;port=3306;dbname=ssdb',
|
||||
'username' => 'devuser',
|
||||
'password' => 'DEV@hdy123456',
|
||||
'database' => 'ssdb',
|
||||
'dbdriver' => 'pdo',
|
||||
'dbprefix' => 'lc_',
|
||||
'pconnect' => FALSE,
|
||||
'db_debug' => (ENVIRONMENT !== 'production'),
|
||||
'cache_on' => FALSE,
|
||||
'cachedir' => '',
|
||||
'char_set' => 'utf8mb4',
|
||||
'dbcollat' => 'utf8_general_ci',
|
||||
'swap_pre' => '',
|
||||
'encrypt' => FALSE,
|
||||
'compress' => FALSE,
|
||||
'stricton' => FALSE,
|
||||
'failover' => array(),
|
||||
'save_queries' => TRUE
|
||||
);
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
$_doctypes = array(
|
||||
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
|
||||
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
|
||||
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
|
||||
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
|
||||
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
|
||||
'html5' => '<!DOCTYPE html>',
|
||||
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
|
||||
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
|
||||
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
|
||||
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
|
||||
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
|
||||
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
|
||||
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
|
||||
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
|
||||
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
|
||||
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
|
||||
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
|
||||
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
|
||||
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
|
||||
);
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| Foreign Characters
|
||||
| -------------------------------------------------------------------
|
||||
| This file contains an array of foreign characters for transliteration
|
||||
| conversion used by the Text helper
|
||||
|
|
||||
*/
|
||||
$foreign_characters = array(
|
||||
'/ä|æ|ǽ/' => 'ae',
|
||||
'/ö|œ/' => 'oe',
|
||||
'/ü/' => 'ue',
|
||||
'/Ä/' => 'Ae',
|
||||
'/Ü/' => 'Ue',
|
||||
'/Ö/' => 'Oe',
|
||||
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
|
||||
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
|
||||
'/Б/' => 'B',
|
||||
'/б/' => 'b',
|
||||
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
|
||||
'/ç|ć|ĉ|ċ|č/' => 'c',
|
||||
'/Д/' => 'D',
|
||||
'/д/' => 'd',
|
||||
'/Ð|Ď|Đ|Δ/' => 'Dj',
|
||||
'/ð|ď|đ|δ/' => 'dj',
|
||||
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
|
||||
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
|
||||
'/Ф/' => 'F',
|
||||
'/ф/' => 'f',
|
||||
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
|
||||
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
|
||||
'/Ĥ|Ħ/' => 'H',
|
||||
'/ĥ|ħ/' => 'h',
|
||||
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
|
||||
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
|
||||
'/Ĵ/' => 'J',
|
||||
'/ĵ/' => 'j',
|
||||
'/Ķ|Κ|К/' => 'K',
|
||||
'/ķ|κ|к/' => 'k',
|
||||
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
|
||||
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
|
||||
'/М/' => 'M',
|
||||
'/м/' => 'm',
|
||||
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
|
||||
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
|
||||
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
|
||||
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
|
||||
'/П/' => 'P',
|
||||
'/п/' => 'p',
|
||||
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
|
||||
'/ŕ|ŗ|ř|ρ|р/' => 'r',
|
||||
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
|
||||
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
|
||||
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
|
||||
'/ț|ţ|ť|ŧ|т/' => 't',
|
||||
'/Þ|þ/' => 'th',
|
||||
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
|
||||
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
|
||||
'/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
|
||||
'/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
|
||||
'/В/' => 'V',
|
||||
'/в/' => 'v',
|
||||
'/Ŵ/' => 'W',
|
||||
'/ŵ/' => 'w',
|
||||
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
|
||||
'/ź|ż|ž|ζ|з/' => 'z',
|
||||
'/Æ|Ǽ/' => 'AE',
|
||||
'/ß/' => 'ss',
|
||||
'/IJ/' => 'IJ',
|
||||
'/ij/' => 'ij',
|
||||
'/Œ/' => 'OE',
|
||||
'/ƒ/' => 'f',
|
||||
'/ξ/' => 'ks',
|
||||
'/π/' => 'p',
|
||||
'/β/' => 'v',
|
||||
'/μ/' => 'm',
|
||||
'/ψ/' => 'ps',
|
||||
'/Ё/' => 'Yo',
|
||||
'/ё/' => 'yo',
|
||||
'/Є/' => 'Ye',
|
||||
'/є/' => 'ye',
|
||||
'/Ї/' => 'Yi',
|
||||
'/Ж/' => 'Zh',
|
||||
'/ж/' => 'zh',
|
||||
'/Х/' => 'Kh',
|
||||
'/х/' => 'kh',
|
||||
'/Ц/' => 'Ts',
|
||||
'/ц/' => 'ts',
|
||||
'/Ч/' => 'Ch',
|
||||
'/ч/' => 'ch',
|
||||
'/Ш/' => 'Sh',
|
||||
'/ш/' => 'sh',
|
||||
'/Щ/' => 'Shch',
|
||||
'/щ/' => 'shch',
|
||||
'/Ъ|ъ|Ь|ь/' => '',
|
||||
'/Ю/' => 'Yu',
|
||||
'/ю/' => 'yu',
|
||||
'/Я/' => 'Ya',
|
||||
'/я/' => 'ya'
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------------
|
||||
| Hooks
|
||||
| -------------------------------------------------------------------------
|
||||
| This file lets you define "hooks" to extend CI without hacking the core
|
||||
| files. Please see the user guide for info:
|
||||
|
|
||||
| https://codeigniter.com/user_guide/general/hooks.html
|
||||
|
|
||||
*/
|
||||
@@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------------
|
||||
| Memcached settings
|
||||
| -------------------------------------------------------------------------
|
||||
| Your Memcached servers can be specified below.
|
||||
|
|
||||
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
||||
|
|
||||
*/
|
||||
$config = array(
|
||||
'default' => array(
|
||||
'hostname' => '192.168.0.16',
|
||||
'port' => '12001',
|
||||
'weight' => '1',
|
||||
),
|
||||
);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user