add-api-licheb-customer-city
This commit is contained in:
@@ -50,14 +50,14 @@ class Customer extends HD_Controller
|
||||
}
|
||||
!$params['search_tp'] && $params['search_tp'] = 'mobile';
|
||||
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
//最近联系时间
|
||||
if ($params['cont_time']) {
|
||||
$cont_time = explode(' ~ ', $params['cont_time']);
|
||||
if ($cont_time[0]) {
|
||||
$where["cont_time >="] = $cont_time[0] . ' 00:00:00';
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
if ($cont_time[1]) {
|
||||
$where["cont_time <="] = $cont_time[1] . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
strlen($params['status']) && $where["status"] = $params['status'];
|
||||
|
||||
@@ -75,11 +75,11 @@
|
||||
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<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"/>
|
||||
<input id="id-create-time" name="cont_time" type="text" value="<?= $params['cont_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">今天</a>
|
||||
|
||||
@@ -115,14 +115,15 @@ class Cusorder extends Wxapp{
|
||||
$payway && $data['payway'] = 1;
|
||||
$pack_id && $data['pack_id'] = $pack_id;
|
||||
$main_type && $data['main_type'] = 1;
|
||||
$info_json = [];
|
||||
if($ifentrust){
|
||||
$data['ifentrust'] = 1;
|
||||
$info_json = [
|
||||
'entrust_name' => $entrust_name,
|
||||
'entrust_idcard' => $entrust_idcard
|
||||
];
|
||||
$data['info_json'] = json_encode($info_json,JSON_UNESCAPED_UNICODE);
|
||||
$info_json['entrust_name'] = $entrust_name;
|
||||
$info_json['entrust_idcard'] = $entrust_idcard;
|
||||
}
|
||||
$cardid && $info_json['c_cardid'] = $cardid;
|
||||
$address && $info_json['c_address'] = $address;
|
||||
$info_json && $data['info_json'] = json_encode($info_json,JSON_UNESCAPED_UNICODE);
|
||||
$o_id = $this->orders_model->add($data);
|
||||
if($o_id){
|
||||
$sign_data = [
|
||||
@@ -301,11 +302,13 @@ class Cusorder extends Wxapp{
|
||||
'购车主体' => $row['main_type'] ? '公司' : '个人',
|
||||
'是否委托' => $row['ifentrust'] ? '是' : '否',
|
||||
];
|
||||
$info_json = json_decode($row['info_json'],true);
|
||||
if($row['ifentrust']){
|
||||
$info_json = json_decode($row['info_json'],true);
|
||||
$car_data['委托人姓名'] = $info_json['entrust_name'] ? $info_json['entrust_name'] : '';
|
||||
$car_data['委托人身份证'] = $info_json['entrust_idcard'] ? $info_json['entrust_idcard'] : '';
|
||||
}
|
||||
$info_json['c_address'] && $car_data['地址'] = $info_json['c_address'];
|
||||
$info_json['c_cardid'] && $car_data['身份证号'] = $info_json['c_cardid'];
|
||||
//开票信息
|
||||
$bill_status = 0;
|
||||
$bill_data = [];
|
||||
|
||||
@@ -23,6 +23,8 @@ class Customers extends Wxapp{
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
|
||||
$this->load->model("biz/biz_model");
|
||||
}
|
||||
|
||||
protected function get(){
|
||||
@@ -57,6 +59,7 @@ class Customers extends Wxapp{
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'mobile' => '****'.substr($row['mobile'],-4),
|
||||
'complete_mobile' => $row['mobile'],
|
||||
'tip' => $tip,
|
||||
'is_top' => $row['is_top'],
|
||||
'status' => $row['status'],
|
||||
@@ -182,6 +185,7 @@ class Customers extends Wxapp{
|
||||
if($this->customers_model->count(['biz_id'=>$biz_id,'mobile'=>$mobile])){
|
||||
throw new Exception('客户已存在', API_CODE_FAIL);
|
||||
}
|
||||
$biz_row = $this->biz_model->get(['id'=>$biz_id]);
|
||||
$row = $this->auto_series_model->get(['id'=>$car_id]);
|
||||
$where = [
|
||||
"id in ($v_id,$color_id)" => null
|
||||
@@ -219,6 +223,8 @@ class Customers extends Wxapp{
|
||||
'cont_time' => date('Y-m-d H:i:s'),
|
||||
'c_time' => time()
|
||||
];
|
||||
$biz_row['city_id'] && $add_data['city_id'] = $biz_row['city_id'];
|
||||
$biz_row['county_id'] && $add_data['county_id'] = $biz_row['county_id'];
|
||||
$buy_time && $add_data['buy_time'] = $buy_time;
|
||||
$cf_clues && $add_data['cf_clues'] = $cf_clues;
|
||||
$result = $this->customers_model->add($add_data);
|
||||
@@ -343,6 +349,8 @@ class Customers extends Wxapp{
|
||||
$iscall = $this->input_param('iscall');
|
||||
$unuse = $this->input_param('unuse'); //未派客户
|
||||
$ismy = $this->input_param('ismy'); //是否只显示自己
|
||||
$name = $this->input_param('name');
|
||||
$mobile = $this->input_param('mobile');
|
||||
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 10;
|
||||
@@ -380,6 +388,8 @@ class Customers extends Wxapp{
|
||||
strlen($status) && $where['status'] = $status;
|
||||
$level && $where['level'] = $level;
|
||||
$cfrom && $where['cf_title'] = $cfrom;
|
||||
$name && $where['name'] = $name;
|
||||
$mobile && $where['mobile'] = $mobile;
|
||||
$count = $this->customers_model->count($where);
|
||||
|
||||
$lists = [];
|
||||
@@ -424,6 +434,7 @@ class Customers extends Wxapp{
|
||||
'id' => $val['id'],
|
||||
'name' => $val['name'],
|
||||
'mobile' => mobile_asterisk($val['mobile']),
|
||||
'complete_mobile' => $val['mobile'],
|
||||
'is_top' => $val['is_top'],
|
||||
'other_data' => $other_data,
|
||||
'tags' => $tags
|
||||
|
||||
@@ -23,7 +23,7 @@ create table lc_receiver_customers (
|
||||
p_time timestamp not null default '0000-00-00 00:00:00' comment '分配时间',
|
||||
cont_time timestamp not null default '0000-00-00 00:00:00' comment '最后联系时间',
|
||||
buy_time tinyint(3) not null default '0' comment '预计购买时间',
|
||||
user_json json default null comment '用户其它数据',
|
||||
info_json json default null comment '用户其它数据',
|
||||
car_json json default null comment '车信息',
|
||||
jsondata json default null comment '其他信息',
|
||||
status tinyint(1) not null default '0' comment '状态:-1删除 0未见客户 1到店客户 2订单客户 3战败客户',
|
||||
|
||||
@@ -153,7 +153,7 @@ create table lc_receiver_order_signs (
|
||||
-- Title:订单表
|
||||
-- Author:lcc
|
||||
-- Table:lc_receiver_orders
|
||||
-- info_json entrust_name 代办人姓名 entrust_idcard 代办人身份证
|
||||
-- info_json entrust_name 代办人姓名 entrust_idcard 代办人身份证 name 姓名 sex 性别 nation 民族 birth 出生日期 address 家庭地址 cardid 身份证 c_address 创建时输入的地址 c_cardid 创建时输入的身份证
|
||||
-- ---------------------------
|
||||
drop table if exists lc_receiver_orders;
|
||||
create table lc_receiver_orders (
|
||||
|
||||
Reference in New Issue
Block a user