diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php
index 7c37c963..c870aa39 100644
--- a/admin/controllers/Common.php
+++ b/admin/controllers/Common.php
@@ -252,14 +252,20 @@ class Common extends CI_Controller
$name = $this->input->post('name');
$role_id = $this->input->post('role_id');
$ids = $this->input->post('ids');
+ $if_mobile = intval($this->input->post('if_mobile'));
$where['status'] = 1;
$name && $where['username like "%' . $name . '%"'] = null;
$role_id && $where['role_id in (' . $role_id . ')'] = null;
$ids && $where['id in (' . $ids . ')'] = null;
$count = $this->mdSysAdmin->count($where);
- $list = array();
+ $list = [];
if ($count) {
- $list = $this->mdSysAdmin->select($where, 'id DESC', $page, $size, 'id,username as name');
+ $select = $if_mobile ? 'id,username,mobile' : 'id,username';
+ $res = $this->mdSysAdmin->select($where, 'id DESC', $page, $size, $select);
+ foreach ($res as $key => $value) {
+ $name = $if_mobile ? $value['username'] . "({$value['mobile']})" : $value['username'];
+ $list[] = ['id' => $value['id'], 'name' => $name];
+ }
}
$this->data['commonList'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
diff --git a/admin/controllers/Login.php b/admin/controllers/Login.php
index 7bbe7a3a..65cb98ec 100644
--- a/admin/controllers/Login.php
+++ b/admin/controllers/Login.php
@@ -103,7 +103,7 @@ class Login extends CI_Controller
);
$this->sys_admin_log_model->add($log);
}
- if ($check_view) {
+ if ($check_view && $admin_user['id'] > 10) {//管理员id>10去掉验证码登录
return $this->show_json(SYS_CODE_SUCCESS, '访问IP发生变化,需要手机验证登录', '/login/check_view');
} else {
$this->sys_admin_model->update(array('login_ip' => $ip), array('id' => $admin_user['id']));
diff --git a/admin/controllers/app/licheb/Member.php b/admin/controllers/app/licheb/Member.php
index 1527d11d..7d9d0efc 100755
--- a/admin/controllers/app/licheb/Member.php
+++ b/admin/controllers/app/licheb/Member.php
@@ -252,6 +252,7 @@ class Member extends HD_Controller
$page = $this->input->post('page');
$size = $this->input->post('size');
$type = intval($this->input->post('type'));
+ $if_mobile = intval($this->input->post('if_mobile'));
$where = array();
if (strlen($status) > 0) {
@@ -263,12 +264,14 @@ class Member extends HD_Controller
$total = $this->userM->count($where);
$lists = $uids = array();
if ($total) {
- $rows = $this->userM->select($where, 'id desc', $page, $size, 'id,uname');
+ $select = $if_mobile ? 'id,uname,mobile' : 'id,uname';
+ $rows = $this->userM->select($where, 'id desc', $page, $size, $select);
foreach ($rows as $v) {
$uids[$v['id']] = $v['id'];
+ $title = $if_mobile ? $v['uname'] . "({$v['mobile']})" : $v['uname'];
$lists[] = array(
'id' => $v['id'],
- 'title' => $v['uname'],
+ 'title' => $title,
);
}
}
@@ -277,12 +280,13 @@ class Member extends HD_Controller
$where2["id in(select uid from lc_app_licheb_channel_biz where biz_id = {$biz_id})"] = null;
$total2 = $this->userM->count($where2);
if ($total2) {
- $rows2 = $this->userM->select($where2, 'id desc', $page, $size, 'id,uname');
+ $rows2 = $this->userM->select($where2, 'id desc', $page, $size, 'id,uname,mobile');
foreach ($rows2 as $v) {
if (!$uids[$v['id']]) {
+ $title = $if_mobile ? $v['uname'] . "({$v['mobile']}渠道)" : $v['uname'] . '(渠道)';
$lists[] = array(
'id' => $v['id'],
- 'title' => $v['uname'] . '(渠道)',
+ 'title' => $title,
);
}
}
diff --git a/admin/controllers/biz/store/Store.php b/admin/controllers/biz/store/Store.php
index 7ae61874..9cdc9d2f 100755
--- a/admin/controllers/biz/store/Store.php
+++ b/admin/controllers/biz/store/Store.php
@@ -268,9 +268,9 @@ class Store extends HD_Controller
$biz['type'] = intval($this->input->post('type', true));
$biz['company_id'] = intval($this->input->post('company_id', true));
$biz['srv_company_id'] = intval($this->input->post('srv_company_id', true));
- $biz['car_brand_id'] = intval($this->input->post('car_brand_id',true));
+ $biz['car_brand_id'] = intval($this->input->post('car_brand_id', true));
- if ($biz['type']==1 && !$biz['car_brand_id']){
+ if ($biz['type'] == 1 && !$biz['car_brand_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择车型品牌');
}
@@ -342,9 +342,9 @@ class Store extends HD_Controller
$biz['type'] = intval($this->input->post('type', true));
$company_id && $biz['company_id'] = $company_id;
$srv_company_id && $biz['srv_company_id'] = $srv_company_id;
- $biz['car_brand_id'] = intval($this->input->post('car_brand_id',true));
+ $biz['car_brand_id'] = intval($this->input->post('car_brand_id', true));
- if ($biz['type']==1 && !$biz['car_brand_id']){
+ if ($biz['type'] == 1 && !$biz['car_brand_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择车型品牌');
}
//上传头像
@@ -1014,16 +1014,17 @@ class Store extends HD_Controller
end:
return array($status, $data, $msg);
}
-
- public function get_info(){
+
+ public function get_info()
+ {
$biz_id = $this->input->get('id');
- if(!$this->biz_model->get(['id'=>$biz_id])){
+ if (!$this->biz_model->get(['id' => $biz_id])) {
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
}
- $base_info = $this->biz_info_model->get(['biz_id'=>$biz_id]);
- if(!$base_info){
- $this->biz_info_model->add(['biz_id'=>$biz_id,'c_time'=>time()]);
- $base_info = $this->biz_info_model->get(['biz_id'=>$biz_id]);
+ $base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
+ if (!$base_info) {
+ $this->biz_info_model->add(['biz_id' => $biz_id, 'c_time' => time()]);
+ $base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
}
$info = [
'id' => $base_info['id'],
@@ -1037,19 +1038,19 @@ class Store extends HD_Controller
'employee_wage' => $base_info['employee_wage'],
'manager_wage' => $base_info['manager_wage'],
'commission' => $base_info['commission'],
- 's_time' => $base_info['s_time'] ? date('Y-m-d',$base_info['s_time']) : '',
- 'e_time' => $base_info['e_time'] ? date('Y-m-d',$base_info['e_time']) : '',
+ 's_time' => $base_info['s_time'] ? date('Y-m-d', $base_info['s_time']) : '',
+ 'e_time' => $base_info['e_time'] ? date('Y-m-d', $base_info['e_time']) : '',
'type' => $base_info['type'],
'rate' => strlen($base_info['rate']) ? $base_info['rate'] : 0,
];
$brands = [];
- $b_rows = $this->biz_trucking_model->select(['biz_id'=>$base_info['biz_id'],'status'=>1],'','','','auto_b_id,money');
- if($b_rows){
- $auto_b_ids = array_column($b_rows,'auto_b_id');
- $auto_b_ids = $auto_b_ids ? implode(',',$auto_b_ids) : 0;
+ $b_rows = $this->biz_trucking_model->select(['biz_id' => $base_info['biz_id'], 'status' => 1], '', '', '', 'auto_b_id,money');
+ if ($b_rows) {
+ $auto_b_ids = array_column($b_rows, 'auto_b_id');
+ $auto_b_ids = $auto_b_ids ? implode(',', $auto_b_ids) : 0;
$where["id in ($auto_b_ids)"] = null;
- $auto_rows = $this->auto_brand_model->map('id','name',$where,'','','','id,name');
- foreach($b_rows as $key=>$val){
+ $auto_rows = $this->auto_brand_model->map('id', 'name', $where, '', '', '', 'id,name');
+ foreach ($b_rows as $key => $val) {
$brands[] = [
'id' => $val['auto_b_id'],
'name' => $auto_rows[$val['auto_b_id']],
@@ -1057,20 +1058,22 @@ class Store extends HD_Controller
];
}
}
- $this->data['type_arr'] = [1=>'扩展',2=>'新增'];
+ $this->data['type_arr'] = [1 => '扩展', 2 => '新建'];
$this->data['brands'] = $brands;
$this->data['info'] = $info;
$this->data['_title'] = '编辑门店基本信息';
$this->show_view('biz/store/get_info', true);
}
- public function edit_info(){
+
+ public function edit_info()
+ {
$info = $this->input->post('info');
$brands = $this->input->post('brands');
- if(!$this->biz_info_model->get(['id'=>$info['id']])){
+ if (!$this->biz_info_model->get(['id' => $info['id']])) {
return $this->show_json(SYS_CODE_FAIL, '错数错误!');
}
- if($info['rate']<0||$info['rate']>100){
+ if ($info['rate'] < 0 || $info['rate'] > 100) {
return $this->show_json(SYS_CODE_FAIL, '分佣比例请填写0~100');
}
$up_data = [
@@ -1088,20 +1091,20 @@ class Store extends HD_Controller
'type' => $info['type'],
'rate' => $info['rate'],
];
- $this->biz_info_model->update($up_data,['id'=>$info['id']]);
- $b_ids = array_column($brands,'id');
- if($b_ids){
- $b_ids = implode(',',$b_ids);
- $this->biz_trucking_model->update(['status'=>-1],["auto_b_id not in ({$b_ids})"=>null,'biz_id'=>$info['biz_id']]);
- foreach($brands as $key=>$val){
- $s_row = $this->biz_trucking_model->get(['biz_id'=>$info['biz_id'],'auto_b_id'=>$val['id']]);
+ $this->biz_info_model->update($up_data, ['id' => $info['id']]);
+ $b_ids = array_column($brands, 'id');
+ if ($b_ids) {
+ $b_ids = implode(',', $b_ids);
+ $this->biz_trucking_model->update(['status' => -1], ["auto_b_id not in ({$b_ids})" => null, 'biz_id' => $info['biz_id']]);
+ foreach ($brands as $key => $val) {
+ $s_row = $this->biz_trucking_model->get(['biz_id' => $info['biz_id'], 'auto_b_id' => $val['id']]);
$data = [
'money' => $val['money'],
'status' => 1
];
- if($s_row){
- $this->biz_trucking_model->update($data,['id'=>$s_row['id']]);
- }else{
+ if ($s_row) {
+ $this->biz_trucking_model->update($data, ['id' => $s_row['id']]);
+ } else {
$data['biz_id'] = $info['biz_id'];
$data['auto_b_id'] = $val['id'];
$data['c_time'] = time();
diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php
index 9d3fa936..21186a90 100644
--- a/admin/libraries/OrdersList.php
+++ b/admin/libraries/OrdersList.php
@@ -17,6 +17,7 @@ class OrdersList
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->ci->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
+ $this->ci->load->model('items/items_model', 'mdItems');
$this->ci->load->model("biz/biz_model");
$this->ci->load->model('auto/auto_series_model');
$this->ci->load->model('auto/auto_brand_model');
@@ -35,7 +36,7 @@ class OrdersList
$show_info['cfTitleAry'] = $this->ci->mdCustomers->get_sdata('cfrom');//来源类型
$show_info['cfCluesAry'] = $this->ci->mdCustomers->get_sdata('cfrom_clues');//线下来源
$show_info['paywayAry'] = $this->paywayAry;//付款方式
- $show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
+ $show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
//渠道经理
$show_info['qdjl_lists'] = $this->ci->mdLichebUsers->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0')
, 'id desc', 0, 0, 'id,uname as name');
@@ -207,7 +208,7 @@ class OrdersList
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
- if($params['vin']){
+ if ($params['vin']) {
$where = ["status>=" => 0];
$where["item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
}
@@ -219,10 +220,10 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -231,7 +232,7 @@ class OrdersList
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
- $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null),'','','','id,uname');
+ $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null), '', '', '', 'id,uname');
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
@@ -439,10 +440,10 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -499,8 +500,8 @@ class OrdersList
$fields['biz_name'] = $map_biz[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
- $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
';
- $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
+ $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)
';
+ $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['order_time'] = $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '';
$lists[] = $fields;
@@ -649,10 +650,10 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -663,7 +664,7 @@ class OrdersList
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
- $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null),'','','','id,uname');
+ $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null), '', '', '', 'id,uname');
foreach ($rows as $key => $val) {
$fields = array();
$money_json = json_decode($val['money_json'], true);
@@ -679,8 +680,8 @@ class OrdersList
$fields['status_name'] = $status_arr[$val['status']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
- $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
';
- $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
+ $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)
';
+ $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
@@ -828,10 +829,10 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -840,7 +841,7 @@ class OrdersList
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
- $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null),'','','','id,uname');
+ $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null), '', '', '', 'id,uname');
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
@@ -877,8 +878,8 @@ class OrdersList
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
- $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
';
- $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
+ $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)
';
+ $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
@@ -1031,15 +1032,20 @@ class OrdersList
$lists = [];
if ($count) {
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
- $fileds .= "$t2.rid,$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.biz_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time,$t2.bill_time,$t2.item_id,$t2.admin_id";
+ $fileds .= "$t2.rid,$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.biz_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id
+ ,$t2.price,$t2.deposit,$t2.payway,$t2.c_time,$t2.bill_time,$t2.item_id,$t2.admin_id";
$rows = $this->ci->order_bills_model->select_order($where, "$t2.c_time desc", $page, $size, $fileds);
+ //门店
+ $str_item_ids = implode(',', array_unique(array_column($rows, 'item_id')));
+ !$str_item_ids && $str_item_ids = 0;
+ $items = $this->ci->mdItems->map('id', 'vin', array("id in({$str_item_ids})" => null));
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -1048,7 +1054,7 @@ class OrdersList
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
- $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null),'','','','id,uname');
+ $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null), '', '', '', 'id,uname');
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
@@ -1081,16 +1087,18 @@ class OrdersList
$fields['deposit'] = number_format($val['deposit'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
+ $jsondata = json_decode($val['jsondata'], true);
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
- $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
';
- $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
+ $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)
';
+ $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['item_id'] = $val['item_id'];
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
+ $fields['vin'] = $items[$val['item_id']] ? $items[$val['item_id']] : '';
$lists[] = $fields;
}
}
@@ -1236,10 +1244,10 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -1248,7 +1256,7 @@ class OrdersList
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
- $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null),'','','','id,uname');
+ $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null), '', '', '', 'id,uname');
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
@@ -1282,18 +1290,18 @@ class OrdersList
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$complete = "";
- $jsondata = json_decode($val['jsondata'],true);
- if($val['ins_img'] && $val['car_img'] && isset($jsondata['register_img']) && $jsondata['register_img']){
+ $jsondata = json_decode($val['jsondata'], true);
+ if ($val['ins_img'] && $val['car_img'] && isset($jsondata['register_img']) && $jsondata['register_img']) {
$complete = "(已完成)";
}
- $fields['status_name'] = $status_arr[$val['status']].$complete;
+ $fields['status_name'] = $status_arr[$val['status']] . $complete;
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
- $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
';
- $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
+ $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)
';
+ $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
- $fields['u_time'] = date('Y-m-d H:i',strtotime($val['u_time']));
+ $fields['u_time'] = date('Y-m-d H:i', strtotime($val['u_time']));
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
}
@@ -1440,10 +1448,10 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
- $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
+ $customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
- if($customers){
- foreach($customers as $key=>$val){
+ if ($customers) {
+ foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
@@ -1452,7 +1460,7 @@ class OrdersList
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
- $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null),'','','','id,uname');
+ $map_admin = $this->ci->mdLichebUsers->map('id', 'uname', array("id in({$str_admin_ids})" => null), '', '', '', 'id,uname');
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
@@ -1489,8 +1497,8 @@ class OrdersList
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
- $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
';
- $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
+ $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)
';
+ $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
@@ -1517,44 +1525,54 @@ class OrdersList
$fields1['name'] = ['title' => '客户姓名'];
$fields1['mobile'] = ['title' => '客户电话'];
} else {
- $fields1['name'] = ['title' => '客户', 'width' => '14%'];
+ $fields1['name'] = ['title' => '客户', 'width' => '12%'];
}
if (strlen($status_pid) && $status_pid == 0) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '22%'],
'biz_name' => ['title' => '门店', 'width' => '10%'], 'price' => ['title' => '合同价', 'width' => '7%'],
- 'payway_name' => ['title' => '付款', 'width' => '5%'],'admin_name' => ['title' => '销售员', 'width' => '7%'],
- 'cf_title' => ['title' => '来源类型', 'width' => '8%'],'cf_name' => ['title' => '来源','width' => '10%'],
+ 'payway_name' => ['title' => '付款', 'width' => '5%'], 'admin_name' => ['title' => '销售员', 'width' => '7%'],
+ 'cf_title' => ['title' => '来源类型', 'width' => '8%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'status_name' => ['title' => '合同状态', 'width' => '7%'], 'order_time' => ['title' => '下定时间', 'width' => '12%']];
$fields = array_merge($fields1, $fields2);
} else if ($status_pid == 1) {
$fields2 = ['title' => ['title' => '分期产品', 'width' => '15%'],
'price_loan' => ['title' => '贷款金额', 'width' => '10%'], 'c_time' => ['title' => '分期时间', 'width' => '7%'],
- 'cf_title' => ['title' => '来源类型', 'width' => '10%'], 'cf_name' => ['title' => '来源','width' => '10%'],
+ 'cf_title' => ['title' => '来源类型', 'width' => '10%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '10%']];
$fields = array_merge($fields1, $fields2);
- } else if ($status_pid == 2 || $status_pid == 3 || $status_pid == 4 || $status_pid == 5) {
+ } else if ($status_pid == 3) {
+ $fields2 = ['car_name' => ['title' => '车辆', 'width' => '22%'],
+ 'vin' => ['title' => '车架号', 'width' => '12%'], 'biz_name' => ['title' => '门店', 'width' => '12%'],
+ 'price' => ['title' => '车辆平台价', 'width' => '9%'], 'admin_name' => ['title' => '销售员', 'width' => '8%'],
+ 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
+ 'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
+ 'status_name' => ['title' => '状态', 'width' => '8%']];
+ $fields = array_merge($fields1, $fields2);
+ } else if ($status_pid == 2 || $status_pid == 4 || $status_pid == 5) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
- 'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源','width' => '10%'],
+ 'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%']];
- $status_pid==4 && $fields2['u_time'] = ['title'=>'更新时间','width'=>'9%'];
+ $status_pid == 4 && $fields2['u_time'] = ['title' => '更新时间', 'width' => '9%'];
$fields = array_merge($fields1, $fields2);
} else {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
- 'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源','width' => '10%'],
+ 'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'],
'c_time' => ['title' => '订单时间', 'width' => '9%']];
$fields = array_merge($fields1, $fields2);
}
return $fields;
}
+
/*
* 导出数据
*/
- public function export_data($pid,$params){
+ public function export_data($pid, $params)
+ {
$indexs = [
'name' => '客户姓名',
'mobile' => '手机号',
@@ -1577,26 +1595,27 @@ class OrdersList
'ins_risk' => ''
];
$temp['bill_time'] = $value['bill_time'] != '0000-00-00 00:00:00' ? $value['bill_time'] : '';
- $agent = $this->ci->order_agents_model->get(['o_id' => $value['o_id']],'jsondata');
- if($agent){
+ $agent = $this->ci->order_agents_model->get(['o_id' => $value['o_id']], 'jsondata');
+ if ($agent) {
$agent_jsondata = $agent['jsondata'] ? json_decode($agent['jsondata'], true) : '';
if (isset($agent_jsondata['if_ins_db']) && $agent_jsondata['if_ins_db']) {
$temp['if_ins_db'] = '是';
isset($agent_jsondata['company']) && $temp['company'] = $agent_jsondata['company'];
isset($agent_jsondata['ins_risk']) && $temp['ins_risk'] = $agent_jsondata['ins_risk'];
isset($agent_jsondata['business_risk']) && $temp['business_risk'] = $agent_jsondata['business_risk'];
- }else{
+ } else {
$temp['if_ins_db'] = '否';
}
}
$data[] = $temp;
}
array_unshift($data, $indexs);
- return ['data'=>$data,'indexs'=>$indexs];
+ return ['data' => $data, 'indexs' => $indexs];
}
//获取子状态中文
- public function sub_status_cn($oid,$status_pid){
+ public function sub_status_cn($oid, $status_pid)
+ {
if ($status_pid == 0) {
$this->ci->load->model('receiver/order/receiver_order_signs_model', 'sub_model');
} else if ($status_pid == 1) {
@@ -1609,11 +1628,11 @@ class OrdersList
$this->ci->load->model('receiver/order/receiver_order_agents_model', 'sub_model');
} else if ($status_pid == 5) {
$this->ci->load->model('receiver/order/receiver_order_deliverys_model', 'sub_model');
- } else{
+ } else {
return '';
}
- $row = $this->ci->sub_model->get(['o_id'=>$oid],'status');
- if(!$row){
+ $row = $this->ci->sub_model->get(['o_id' => $oid], 'status');
+ if (!$row) {
return '';
}
$status_arr = $this->ci->mdOrders->statusAry($status_pid);
diff --git a/admin/views/biz/store/get_info.php b/admin/views/biz/store/get_info.php
index 168c84ba..2c3762ea 100644
--- a/admin/views/biz/store/get_info.php
+++ b/admin/views/biz/store/get_info.php
@@ -1,4 +1,5 @@
-