diff --git a/admin/controllers/app/liche/Main.php b/admin/controllers/app/liche/Main.php
index fbf0d8b4..a225346e 100644
--- a/admin/controllers/app/liche/Main.php
+++ b/admin/controllers/app/liche/Main.php
@@ -67,9 +67,10 @@ class Main extends HD_Controller
/*小程序设置 end*/
$list = [];
+ $value = $this->userM->count(['dealer'=>1,'up_uid'=>0]);
$list[] = array(
'title' => '分销用户(人)',
- 'value' => 0,
+ 'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/appdistribution/distribution?app_id='.$this->app_id),
),
diff --git a/admin/controllers/app/liche/Member.php b/admin/controllers/app/liche/Member.php
index 48febcdb..192794b6 100755
--- a/admin/controllers/app/liche/Member.php
+++ b/admin/controllers/app/liche/Member.php
@@ -112,11 +112,9 @@ class Member extends HD_Controller{
$id = $this->input->post('id');
$dealer = $this->input->post('dealer');
-
$upd = [
'dealer' => $dealer,
];
-
$this->userM->update($upd, array('id' => $id));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
diff --git a/admin/controllers/auto/Brand.php b/admin/controllers/auto/Brand.php
new file mode 100644
index 00000000..5d513fd4
--- /dev/null
+++ b/admin/controllers/auto/Brand.php
@@ -0,0 +1,140 @@
+load->model('auto/auto_brand_model');
+ }
+
+ public function index(){
+ $this->lists();
+ }
+
+ public function lists(){
+ $params = $this->input->get();
+ $page = $this->input->get('page');
+ !$page && $page = 1;
+ $size = 20;
+ $where["status > -1"] = null;
+ $params['title'] && $where["name like '%{$params['title']}%'"] = null;
+ $count = $this->auto_brand_model->count($where);
+ $rows = $this->auto_brand_model->select($where, 'id desc', $page, $size);
+ $status_arr = $this->auto_brand_model->get_status();
+ $list = [];
+ if($rows){
+ foreach($rows as $key=>$val){
+ $list[] = [
+ 'id' => $val['id'],
+ 'name' => $val['name'],
+ 'status' => $val['status'],
+ 'status_name' => $status_arr[$val['status']],
+ 'c_time' => date('Y-m-d H:i:s',$val['c_time'])
+ ];
+ }
+ }
+ $this->data['lists'] = $list;
+ $this->data['params'] = $params;
+ $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
+ $this->data['_title'] = '品牌列表';
+ $this->show_view('auto/brand/lists', true);
+ }
+
+ public function get(){
+ $id = $this->input->get('id');
+
+ $info = [];
+ if ($id) {
+ $info = $this->auto_brand_model->get(array('id' => $id));
+ if (!$info || empty($info)) {
+ return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
+ }
+ }
+
+ $this->data['info'] = $info;
+ $this->data['_title'] = $id ? '编辑品牌' : '新增品牌';
+ return $this->show_view('auto/brand/edit');
+ }
+
+ public function add(){
+ if (!$this->if_ajax) {
+ return $this->show_json(SYS_CODE_FAIL, '提交出错!');
+ }
+ $id = $this->input->post('id');
+ $name = $this->input->post('name');
+ $img = $this->input->post('img');
+ if (!$name || empty($name)) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
+ }
+ $old = $this->auto_brand_model->get(['name'=>$name,'status>'=>-1]);
+ if ($old) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌已经存在');
+ }
+ $add_data = array(
+ 'name' => $name,
+ 'logo' => $img,
+ 'c_time' => time()
+ );
+ $brand_id = $this->auto_brand_model->add($add_data);
+ if (!$brand_id) {
+ return $this->show_json(SYS_CODE_FAIL, '添加失败');
+ }
+ return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
+ }
+
+ public function edit(){
+ if (!$this->if_ajax) {
+ return $this->show_json(SYS_CODE_FAIL, '提交出错!');
+ }
+ $id = $this->input->post('id');
+ $name = $this->input->post('name');
+ $img = $this->input->post('img');
+ $row = $this->auto_brand_model->get(['id' => $id]);
+ if (!$row) {
+ return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
+ }
+ if (!$name) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
+ }
+ //防止品牌名称重复
+ $where = array('name' => $name, "status<>-1" => null);
+ $id && $where['id <>'] = $id;
+ $old = $this->auto_brand_model->get($where);
+ if ($old) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌已经存在');
+ }
+ $up_data = array(
+ 'name' => $name,
+ );
+ $img && $up_data['logo'] = $img;
+ $this->auto_brand_model->update($up_data, array('id' => $id));
+ return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
+ }
+
+ public function del(){
+ $id = $this->input->post('id');
+ if (!$id) {
+ $this->show_json(SYS_CODE_FAIL, '参数错误');
+ }
+ $stauts = $this->input->post('status');
+ $where = array('id' => $id);
+ $this->auto_brand_model->update(array('status' => $stauts), $where);
+ return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
+ }
+
+ public function batch(){
+
+ }
+
+ public function export(){
+
+ }
+
+}
diff --git a/admin/controllers/auto/Series.php b/admin/controllers/auto/Series.php
new file mode 100644
index 00000000..0711b664
--- /dev/null
+++ b/admin/controllers/auto/Series.php
@@ -0,0 +1,141 @@
+load->model('auto/auto_brand_model');
+ $this->load->model('auto/auto_series_model');
+ }
+
+ public function index(){
+ $this->lists();
+ }
+
+ public function lists(){
+ $params = $this->input->get();
+ $page = $this->input->get('page');
+ !$page && $page = 1;
+ $size = 20;
+ $where["status > -1"] = null;
+ $params['title'] && $where["name like '%{$params['title']}%'"] = null;
+ $count = $this->auto_brand_model->count($where);
+ $rows = $this->auto_brand_model->select($where, 'id desc', $page, $size);
+ $status_arr = $this->auto_brand_model->get_status();
+ $list = [];
+ if($rows){
+ foreach($rows as $key=>$val){
+ $list[] = [
+ 'id' => $val['id'],
+ 'name' => $val['name'],
+ 'status' => $val['status'],
+ 'status_name' => $status_arr[$val['status']],
+ 'c_time' => date('Y-m-d H:i:s',$val['c_time'])
+ ];
+ }
+ }
+ $this->data['lists'] = $list;
+ $this->data['params'] = $params;
+ $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
+ $this->data['_title'] = '品牌列表';
+ $this->show_view('auto/brand/lists', true);
+ }
+
+ public function get(){
+ $id = $this->input->get('id');
+
+ $info = [];
+ if ($id) {
+ $info = $this->auto_brand_model->get(array('id' => $id));
+ if (!$info || empty($info)) {
+ return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
+ }
+ }
+
+ $this->data['info'] = $info;
+ $this->data['_title'] = $id ? '编辑品牌' : '新增品牌';
+ return $this->show_view('auto/brand/edit');
+ }
+
+ public function add(){
+ if (!$this->if_ajax) {
+ return $this->show_json(SYS_CODE_FAIL, '提交出错!');
+ }
+ $id = $this->input->post('id');
+ $name = $this->input->post('name');
+ $img = $this->input->post('img');
+ if (!$name || empty($name)) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
+ }
+ $old = $this->auto_brand_model->get(['name'=>$name,'status>'=>-1]);
+ if ($old) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌已经存在');
+ }
+ $add_data = array(
+ 'name' => $name,
+ 'logo' => $img,
+ 'c_time' => time()
+ );
+ $brand_id = $this->auto_brand_model->add($add_data);
+ if (!$brand_id) {
+ return $this->show_json(SYS_CODE_FAIL, '添加失败');
+ }
+ return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
+ }
+
+ public function edit(){
+ if (!$this->if_ajax) {
+ return $this->show_json(SYS_CODE_FAIL, '提交出错!');
+ }
+ $id = $this->input->post('id');
+ $name = $this->input->post('name');
+ $img = $this->input->post('img');
+ $row = $this->auto_brand_model->get(['id' => $id]);
+ if (!$row) {
+ return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
+ }
+ if (!$name) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
+ }
+ //防止品牌名称重复
+ $where = array('name' => $name, "status<>-1" => null);
+ $id && $where['id <>'] = $id;
+ $old = $this->auto_brand_model->get($where);
+ if ($old) {
+ return $this->show_json(SYS_CODE_FAIL, '品牌已经存在');
+ }
+ $up_data = array(
+ 'name' => $name,
+ );
+ $img && $up_data['logo'] = $img;
+ $this->auto_brand_model->update($up_data, array('id' => $id));
+ return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
+ }
+
+ public function del(){
+ $id = $this->input->post('id');
+ if (!$id) {
+ $this->show_json(SYS_CODE_FAIL, '参数错误');
+ }
+ $stauts = $this->input->post('status');
+ $where = array('id' => $id);
+ $this->auto_brand_model->update(array('status' => $stauts), $where);
+ return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
+ }
+
+ public function batch(){
+
+ }
+
+ public function export(){
+
+ }
+
+}
diff --git a/admin/views/app/liche/member/lists.php b/admin/views/app/liche/member/lists.php
index e22a63f1..011a8a2d 100755
--- a/admin/views/app/liche/member/lists.php
+++ b/admin/views/app/liche/member/lists.php
@@ -37,7 +37,7 @@
= $v['nickname'] ?> |
= $v['mobile'] ?> |
- onchange="set_publish(this,=$v['id']?>)"/>
+ onchange="set_publish(this,=$v['id']?>)"/>
|
= date('Y-m-d H:i:s',$v['c_time']) ?> |
diff --git a/admin/views/auto/brand/edit.php b/admin/views/auto/brand/edit.php
new file mode 100755
index 00000000..f332ead2
--- /dev/null
+++ b/admin/views/auto/brand/edit.php
@@ -0,0 +1,30 @@
+
diff --git a/admin/views/auto/brand/lists.php b/admin/views/auto/brand/lists.php
new file mode 100755
index 00000000..40493b12
--- /dev/null
+++ b/admin/views/auto/brand/lists.php
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ | ID |
+ 品牌名称 |
+ 状态 |
+ 创建时间 |
+ 操作 |
+
+
+
+
+
+ | = $v['id'] ?> |
+ = $v['name'] ?> |
+ = $v['status_name'] ?> |
+ = $v['c_time'] ?> |
+
+ = '编辑' ?> |
+
+ 禁用
+
+ 恢复
+
+ |
+
+
+
+
+
+
+
+
+
+
+
diff --git a/api/controllers/wxapp/liche/Car.php b/api/controllers/wxapp/liche/Car.php
index f95e32cd..9f35664d 100644
--- a/api/controllers/wxapp/liche/Car.php
+++ b/api/controllers/wxapp/liche/Car.php
@@ -45,7 +45,7 @@ class Car extends Wxapp{
$version[] = [
'id' => $val['id'],
'title' => $val['title'],
- 'v' => number_format($jsondata['v']).'元起',
+ 'v' => number_format($jsondata['price']).'元起',
];
}else{ //颜色
$color[] = [
diff --git a/api/controllers/wxapp/licheb/Cusorder.php b/api/controllers/wxapp/licheb/Cusorder.php
index b5046a7e..5cbcb4aa 100644
--- a/api/controllers/wxapp/licheb/Cusorder.php
+++ b/api/controllers/wxapp/licheb/Cusorder.php
@@ -260,7 +260,7 @@ class Cusorder extends Wxapp{
'车辆名称' => $brand['name'].$series['name'],
'车辆级别' => $version,
'颜色' => $color,
- '车辆平台价格' => $row['price'],
+ '车辆合同售价' => $row['price'],
'定金' => $row['deposit']
];
//开票信息
diff --git a/api/controllers/wxapp/licheb/Customerlogs.php b/api/controllers/wxapp/licheb/Customerlogs.php
index 4eb243ec..e1e6d974 100644
--- a/api/controllers/wxapp/licheb/Customerlogs.php
+++ b/api/controllers/wxapp/licheb/Customerlogs.php
@@ -89,4 +89,20 @@ class Customerlogs extends Wxapp{
}
return $data;
}
+
+ protected function post(){
+ $id = $this->input_param('cus_id');
+ $log = $this->input_param('content');
+ $img_arr = $this->input_param('imgs');
+ if(!$log && !$img_arr){
+ throw new Exception('参数错误', ERR_PARAMS_ERROR);
+ }
+ $this->load->library('receiver/customers_entity');
+ $result = $this->customers_entity->add_log($id,$this->session['uid'],$this->session['uname'],$log,'','wxapp',$img_arr);
+ if($result){
+ throw new Exception('修改成功', API_CODE_SUCCESS);
+ }else{
+ throw new Exception('修改失败', ERR_PARAMS_ERROR);
+ }
+ }
}
diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php
index 7fa7686e..d3623464 100644
--- a/api/controllers/wxapp/licheb/Customers.php
+++ b/api/controllers/wxapp/licheb/Customers.php
@@ -22,6 +22,7 @@ class Customers extends Wxapp{
$this->load->model('receiver/receiver_customer_oplogs_model','customer_oplogs_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
+ $this->load->model('auto/auto_attr_model');
}
protected function get(){
@@ -77,17 +78,93 @@ class Customers extends Wxapp{
if(!$row){
throw new Exception('数据不存在', ERR_PARAMS_ERROR);
}
+ $car_json = json_decode($row['car_json'],true);
$data['baseinfo'] = [
- '客户姓名' => $row['name'],
- '客户电话' => mobile_asterisk($row['mobile']),
+ 'name' => ['value'=>$row['name'],'cn'=>'客户姓名'],
+ 'mobile' => ['value'=>mobile_asterisk($row['mobile']),'cn'=>'客户电话'],
+ 'car_id' => ['value'=>$row['s_id'],'cn'=>'品牌车型'],
+ 'v_id' => ['value'=>$row['v_id'],'cn'=>'车型级别'],
+ 'color_id' => ['value'=>$car_json['c_id'],'cn'=>'车型颜色'],
+ 'cf_clues' => ['value'=>$row['cf_clues'],'cn'=>'线索来源'],
+ 'buy_time' => ['value'=>$row['buy_time'],'cn'=>'预计购车时间'],
];
return $data;
}
+ //修改基本信息
+ protected function put_data(){
+ $biz_id = $this->session['biz_id'];
+
+ $id = $this->input_param('cus_id');
+ $name = $this->input_param('name');
+ $mobile = $this->input_param('mobile');
+ $car_id = $this->input_param('car_id'); //品牌车型id
+ $v_id = $this->input_param('v_id'); //车型id
+ $color_id = $this->input_param('color_id'); //颜色id
+ $cf_clues = $this->input_param('cf_clues'); //线索来源
+ $buy_time = $this->input_param('buy_time'); //预计购车时间
+ $row = $this->customers_model->get(['id'=>$id]);
+ if(!$row){
+ throw new Exception('参数错误', ERR_PARAMS_ERROR);
+ }
+ $car_json = json_decode($row['car_json'],true);
+ $update = [];
+ if($mobile){
+ if(!mobile_valid($mobile)){
+ throw new Exception('手机号格式错误', ERR_PARAMS_ERROR);
+ }
+ if($this->customers_model->count(['biz_id'=>$biz_id,'mobile'=>$mobile])){
+ throw new Exception('客户已存在', API_CODE_FAIL);
+ }
+ $update['mobile'] = $mobile;
+ }
+ $s_row = $this->auto_series_model->get(['id'=>$car_id]);
+ $ids_arr = [];
+ if($v_id){
+ $car_json['v_id'] = $v_id;
+ $ids_arr[] = $v_id;
+ }
+ if($color_id){
+ $car_json['c_id'] = $color_id;
+ $ids_arr[] = $color_id;
+ }
+ $attr_row = $this->auto_attr_model->get_map_by_ids($ids_arr);
+ if($attr_row[$color_id]){
+ $color_row = $attr_row[$color_id][0];
+ $color_row['jsondata'] = json_decode($color_row['jsondata'],true);
+ isset($color_row) && $car_json['color'] = $color_row;
+ }
+ if($attr_row[$v_id]){
+ $version_row = $attr_row[$v_id][0];
+ $version_row['jsondata'] = json_decode($version_row['jsondata'],true);
+ isset($version_row) && $car_json['version'] = $version_row;
+ }
+ $update['car_json'] = json_encode($car_json,JSON_UNESCAPED_UNICODE);
+ $name && $update['name'] = $name;
+ $cf_clues && $update['cf_clues'] = $cf_clues;
+ $v_id && $update['v_id'] = $v_id;
+ if($s_row){
+ $update['s_id'] = $s_row['id'];
+ $update['brand_id'] = $s_row['brand_id'];
+ }
+ $s_row && $update['s_id'] = $s_row;
+ if($buy_time){
+ $this->load->library('receiver/customers_entity');
+ $update['level'] = $this->customers_entity->cal_level($buy_time);
+ $update['buy_time'] = $buy_time;
+ }
+ $result = $this->customers_model->update($update,['id'=>$id]);
+ if($result){
+ $uname = $this->session['uname'];
+ $this->load->library('receiver/customers_entity');
+ $this->customers_entity->add_log($id,$this->session['uid'],$uname,"修改用户基本信息");
+ throw new Exception('保存成功', API_CODE_SUCCESS);
+ }else{
+ throw new Exception('保存失败', ERR_PARAMS_ERROR);
+ }
+ }
//创建客户
protected function post(){
$biz_id = $this->session['biz_id'];
- $this->load->model('auto/auto_series_model');
- $this->load->model('auto/auto_attr_model');
$name = $this->input_param('name');
$mobile = $this->input_param('mobile');
@@ -95,6 +172,7 @@ class Customers extends Wxapp{
$v_id = $this->input_param('v_id'); //车型id
$color_id = $this->input_param('color_id'); //颜色id
$back_s_id = $this->input_param('b_s_id'); //备选车型
+ $cf_clues = $this->input_param('cf_clues'); //线索来源
$buy_time = $this->input_param('buy_time'); //预计购车时间
if(!mobile_valid($mobile)) throw new Exception('请输入正确的手机号码', ERR_PARAMS_ERROR);
@@ -125,7 +203,7 @@ class Customers extends Wxapp{
'version' => isset($version_row) ? $version_row : ''
];
$this->load->library('receiver/customers_entity');
- $level = $this->customers_entity->cal_level(strtotime($buy_time),time());
+ $level = $this->customers_entity->cal_level($buy_time);
$add_data = [
'name' => $name,
@@ -141,7 +219,8 @@ class Customers extends Wxapp{
'cont_time' => date('Y-m-d H:i:s'),
'c_time' => time()
];
- $buy_time && $add_data['buy_time'] = date('Y-m-d H:i:s',strtotime($buy_time));
+ $buy_time && $add_data['buy_time'] = $buy_time;
+ $cf_clues && $add_data['cf_clues'] = $cf_clues;
$result = $this->customers_model->add($add_data);
if($result){
$uname = $this->session['uname'];
@@ -228,16 +307,16 @@ class Customers extends Wxapp{
}
return $lists;
}
-
+
//获取筛选条件
protected function get_filter(){
-
- $this->load->library('receiver/customers_entity');
- $level = $this->customers_entity->get_level();
- $cfrom = ['自行到店','平台分配'];
+ $level = $this->customers_model->get_sdata('level');
+ $cfrom = $this->customers_model->get_sdata();
+ $buy_time = $this->customers_model->get_sdata('btime');
$data = [
'level' => $level,
- 'cfrom' => $cfrom
+ 'cfrom' => $cfrom,
+ 'buy_time' => $buy_time
];
return $data;
}
@@ -383,7 +462,7 @@ class Customers extends Wxapp{
if($rid){ //更新线索跟进人
$this->clues_model->update(['admin_id'=>$admin_id,'status'=>2],['id'=>$rid]);
}
- $log = "【{$uname}】分配客户";
+ $log = "分配客户";
$this->customers_entity->add_log($val,$uid,$uname,$log);
}
throw new Exception('分配成功', API_CODE_SUCCESS);
diff --git a/common/libraries/receiver/Customers_entity.php b/common/libraries/receiver/Customers_entity.php
index 38495103..2b829f06 100644
--- a/common/libraries/receiver/Customers_entity.php
+++ b/common/libraries/receiver/Customers_entity.php
@@ -7,7 +7,7 @@ class Customers_entity{
private $ci;
- private $level = ['H','A','B','C','D'];
+ private $level = [3=>'H',7=>'A',15=>'B',30=>'C'];
public function __construct(){
$this->ci = & get_instance();
}
@@ -21,17 +21,18 @@ class Customers_entity{
* @param $type int 操作类型 (0普通日志 1短信 2拨打电话)
* @param $cf_platform string 来源 (wxapp小程序 admin后台)
*/
- public function add_log($customer_id,$uid,$uname,$content,$type='',$cf_platform='wxapp'){
+ public function add_log($customer_id,$uid,$uname,$content,$type='',$cf_platform='wxapp',$imgs = []){
$this->ci->load->model('receiver/receiver_customer_oplogs_model','customer_oplogs_model');
$add_data = [
'customer_id' => $customer_id,
'uid' => $uid,
- 'log' => $content,
'c_time' => time()
];
+ $content && $add_data['log'] = $content;
$uname && $add_data['uname'] = $uname;
$type && $add_data['type'] = $type;
$cf_platform && $add_data['cf_platform'] = $cf_platform;
+ $imgs && $add_data['imgs'] = json_encode($imgs,JSON_UNESCAPED_UNICODE);
$result = $this->ci->customer_oplogs_model->add($add_data);
if($type==2 && $result){ //更新最后联系时间
$this->ci->load->model('receiver/receiver_customers_model');
@@ -41,29 +42,17 @@ class Customers_entity{
}
/**
* 购车时间计算用户等级
- * @param $buy_time int 预计购车时间戳
- * @param $c_time int 创建时间
+ * @param $buy_time int 预计购车天数
*/
- public function cal_level($buy_time,$c_time){
- $time = $buy_time - $c_time;
- if($time<=3*24*60*60){
- $level = 'H';
- }elseif($time>3*24*60*60 && $time<=7*24*60*60){
- $level = 'A';
- }elseif($time>7*24*60*60 && $time<=15*24*60*60){
- $level = 'B';
- }elseif($time>15*24*60*60 && $time<=30*24*60*60){
- $level = 'C';
+ public function cal_level($buy_time){
+ if($this->level[$buy_time]){
+ $level = $this->level[$buy_time];
}else{
- $level = 'D';
+ $level = 'C';
}
return $level;
}
- //返回用户等级数组
- public function get_level(){
- return $this->level;
- }
}
?>
diff --git a/common/models/auto/Auto_brand_model.php b/common/models/auto/Auto_brand_model.php
index c19850bd..06e7db12 100644
--- a/common/models/auto/Auto_brand_model.php
+++ b/common/models/auto/Auto_brand_model.php
@@ -10,6 +10,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Auto_brand_model extends HD_Model
{
private $table_name = 'lc_auto_brand';
+ private $status_arr = [ '-1' => '删除',0 => '下架',1 => '正常'];
public function __construct()
{
@@ -37,4 +38,8 @@ class Auto_brand_model extends HD_Model
}
return $rows;
}
+ //获取状态
+ public function get_status(){
+ return $this->status_arr;
+ }
}
diff --git a/common/models/receiver/Receiver_customers_model.php b/common/models/receiver/Receiver_customers_model.php
index 79ca0bbd..bf8dbde2 100644
--- a/common/models/receiver/Receiver_customers_model.php
+++ b/common/models/receiver/Receiver_customers_model.php
@@ -13,6 +13,9 @@ class Receiver_customers_model extends HD_Model
private $table_name = 'lc_receiver_customers';
private $status_arr = [-1 => '删除',0 => '未见客户',1 => '到店客户',2 => '订单客户',3 => '战败客户'];
+ private $level = ['H','A','B','C','D'];
+ private $cfrom_arr = ['自行到店','平台分配'];
+ private $buy_time = [3,7,15,30];
public function __construct()
{
parent::__construct($this->table_name, 'default');
@@ -41,6 +44,23 @@ class Receiver_customers_model extends HD_Model
public function get_status(){
return $this->status_arr;
}
+
+ public function get_sdata($type='cfrom'){
+ switch($type){
+ case 'cfrom':
+ $result = $this->cfrom_arr;
+ break;
+ case 'btime':
+ $result = $this->buy_time;
+ break;
+ case 'level':
+ $result = $this->level;
+ break;
+ default:
+ $result = '';
+ }
+ return $result;
+ }
public function count_order($where){
return $this->select_order($where,'','','','',1);
diff --git a/sql/auto.sql b/sql/auto.sql
index 2a642cb5..51dcadff 100644
--- a/sql/auto.sql
+++ b/sql/auto.sql
@@ -12,6 +12,7 @@ create table lc_auto_brand (
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='车型库_品牌';
+alter table lc_auto_brand add logo varchar(70) not null default '' comment '品牌logo' after name;
-- ----------------------------
-- Title:车型库_车系
diff --git a/sql/receiver/customer.sql b/sql/receiver/customer.sql
index ab32da9f..37eb3e9f 100644
--- a/sql/receiver/customer.sql
+++ b/sql/receiver/customer.sql
@@ -22,7 +22,7 @@ create table lc_receiver_customers (
a_num tinyint(3) not null default '0' comment '到店次数',
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 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 '用户其它数据',
car_json json default null comment '车信息',
jsondata json default null comment '其他信息',
@@ -31,6 +31,7 @@ create table lc_receiver_customers (
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='客户表';
+alter table lc_receiver_customers add cf_clues varchar(50) not null default '' comment '线索来源' after cf_title;
-- ----------------------------
-- Title:客户操作日志表
@@ -50,4 +51,5 @@ create table lc_receiver_customer_oplogs (
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='客户操作日志表';
+alter table lc_receiver_customer_oplogs add imgs json default null comment '图片' after log;
diff --git a/www/admin/favicon.ico b/www/admin/favicon.ico
index e69de29b..102deb7b 100644
Binary files a/www/admin/favicon.ico and b/www/admin/favicon.ico differ
diff --git a/www/api/favicon.ico b/www/api/favicon.ico
index e69de29b..102deb7b 100644
Binary files a/www/api/favicon.ico and b/www/api/favicon.ico differ
diff --git a/www/home/favicon.ico b/www/home/favicon.ico
index e69de29b..102deb7b 100644
Binary files a/www/home/favicon.ico and b/www/home/favicon.ico differ