admin_408

This commit is contained in:
dengbw
2022-04-08 15:36:14 +08:00
parent 2f82a576d4
commit 52d7c341c8
8 changed files with 184 additions and 145 deletions
+8 -2
View File
@@ -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;
+1 -1
View File
@@ -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']));
+8 -4
View File
@@ -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,
);
}
}
+36 -33
View File
@@ -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();
+82 -64
View File
@@ -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'].'(线上)<br>';
$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'] . '(线上)<br>';
$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'].'(线上)<br>';
$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'] . '(线上)<br>';
$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'].'(线上)<br>';
$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'] . '(线上)<br>';
$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,17 +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);
$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'].'(线上)<br>';
$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'] . '(线上)<br>';
$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;
}
}
@@ -1237,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'];
}
//获取来源
@@ -1249,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;
@@ -1283,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'].'(线上)<br>';
$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'] . '(线上)<br>';
$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;
}
@@ -1441,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'];
}
//获取来源
@@ -1453,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;
@@ -1490,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'].'(线上)<br>';
$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'] . '(线上)<br>';
$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;
@@ -1518,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' => '手机号',
@@ -1578,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) {
@@ -1610,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);
+24 -20
View File
@@ -1,4 +1,5 @@
<form id="vue-edit" class="am-form am-form-horizontal" :action="action" data-auto="true" method="post" style="width: 90%;padding-top: 10px">
<form id="vue-edit" class="am-form am-form-horizontal" :action="action" 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 w300">
@@ -14,7 +15,7 @@
<div class="am-form-group">
<label class="am-para-label">类型:</label>
<div class="am-para-input w150">
<select v-model="info.type">
<select v-model="info.type">
<option v-for="(v,i) in type_arr" :value="i">{{v}}</option>
</select>
</div>
@@ -80,15 +81,17 @@
<div>
<input value="" class="wp80" type="number" v-model="v.money" placeholder="拖车金额">
</div>
<div>
<div>
</template>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">合作时间:</label>
<div class="am-para-input">
<input type="text" id="s_time" style="width:200px;display:inline" placeholder="开始时间" name="" autocomplete="off" v-model="info.s_time"/>
<input type="text" id="e_time" style="width:200px;display:inline" placeholder="结束时间" name="" autocomplete="off" v-model="info.e_time"/>
<input type="text" id="s_time" style="width:200px;display:inline" placeholder="开始时间" name=""
autocomplete="off" v-model="info.s_time"/>
<input type="text" id="e_time" style="width:200px;display:inline" placeholder="结束时间" name=""
autocomplete="off" v-model="info.e_time"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
@@ -129,7 +132,8 @@
{{v.name}}
</td>
<td class="vuetable-slot text-right">
<button type='button' v-if="v.is_checked==0 || !v.is_checked" class="btn btn-sm btn-success"
<button type='button' v-if="v.is_checked==0 || !v.is_checked"
class="btn btn-sm btn-success"
@click="addItem(i)">添加
</button>
<button type='button' v-if="v.is_checked==1" class="btn btn-sm btn-danger"
@@ -160,7 +164,7 @@
</div>
</div>
</div>
</form>
<script>
require(['laydate'], function (laydate) {
@@ -173,27 +177,27 @@
});
var loading = 0;
var vue_obj;
$(function(){
$(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info:{},
action:'/biz/store/store/edit_info',
info: {},
action: '/biz/store/store/edit_info',
brandsList: [],
brandsPage: [],
selectedBrands: [],
type_arr: []
},
mounted:function(){
mounted: function () {
var vm = this;
vm.info = <?=$info ? json_encode($info) : '{}'?>;
vm.selectedBrands = <?=json_encode($brands,JSON_UNESCAPED_UNICODE)?>;
vm.type_arr = <?=json_encode($type_arr,JSON_UNESCAPED_UNICODE)?>;
vm.selectedBrands = <?=json_encode($brands, JSON_UNESCAPED_UNICODE)?>;
vm.type_arr = <?=json_encode($type_arr, JSON_UNESCAPED_UNICODE)?>;
},
methods:{
saveEdit:function(){
methods: {
saveEdit: function () {
var vm = this;
if(1 == loading){
if (1 == loading) {
return 0;
}
loading = 1;
@@ -204,7 +208,7 @@
url: vm.action,
type: 'post',
dataType: 'json',
data: {info:vm.info,brands:vm.selectedBrands},
data: {info: vm.info, brands: vm.selectedBrands},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
@@ -247,7 +251,7 @@
//page: that.brandsThPage,
//ids: that.sys_type_id == 1 ? that.info.brandIds : that.info.bizIds,
};
$.post('/common/brands',data,function(json){
$.post('/common/brands', data, function (json) {
var brandsList = json.data.itemsList;
that.brandsPage = json.data.itemsPage;
brandsList.map(function (_item, _index) {
@@ -264,7 +268,7 @@
}
})
that.brandsList = brandsList;
},'json');
}, 'json');
},
beforeShopPage: function () {
var vm = this;
@@ -308,7 +312,7 @@
})
},
},
watch:{}
watch: {}
});
});
</script>
+24 -20
View File
@@ -80,7 +80,7 @@
</select>
</div>
<div v-if="takeCar1.type==2">
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar1.admin_id">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar1.adminList">
@@ -88,7 +88,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar1.addr_id">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar1.addrList">
@@ -98,7 +98,7 @@
</div>
</div>
<div v-else>
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar1.biz_id">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar1.bizList">
@@ -106,7 +106,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar1.uid">
<option value="">提车人</option>
<template v-for="(v,i) in takeCar1.uidList">
@@ -141,7 +141,7 @@
</select>
</div>
<div v-if="takeCar2.type==2">
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar2.admin_id">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar2.adminList">
@@ -149,7 +149,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar2.addr_id">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar2.addrList">
@@ -159,7 +159,7 @@
</div>
</div>
<div v-else>
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar2.biz_id">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar2.bizList">
@@ -167,7 +167,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar2.uid">
<option value="">备用提车人</option>
<template v-for="(v,i) in takeCar2.uidList">
@@ -198,7 +198,7 @@
</select>
</div>
<div v-if="takeCar3.type==2">
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar3.admin_id">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar3.adminList">
@@ -206,7 +206,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar3.addr_id">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar3.addrList">
@@ -216,7 +216,7 @@
</div>
</div>
<div v-else>
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar3.biz_id">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar3.bizList">
@@ -224,7 +224,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar3.uid">
<option value="">接车人</option>
<template v-for="(v,i) in takeCar3.uidList">
@@ -259,7 +259,7 @@
</select>
</div>
<div v-if="takeCar4.type==2">
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar4.admin_id">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar4.adminList">
@@ -267,7 +267,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar4.addr_id">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar4.addrList">
@@ -277,7 +277,7 @@
</div>
</div>
<div v-else>
<div class="am-para-inline w180">
<div class="am-para-inline w210">
<select v-model="takeCar4.biz_id">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar4.bizList">
@@ -285,7 +285,7 @@
</template>
</select>
</div>
<div class="am-para-inline w150">
<div class="am-para-inline w210">
<select v-model="takeCar4.uid">
<option value="">备用接车人</option>
<template v-for="(v,i) in takeCar4.uidList">
@@ -528,7 +528,7 @@
type: 'post',
url: '/common/admin_app',
dataType: 'json',
data: {role_id: 33},
data: {role_id: 33, if_mobile: 1},
success: function (response) {
if (response.code == 1) {
var items = [];
@@ -590,7 +590,7 @@
type: 'post',
url: '/common/admin_app',
dataType: 'json',
data: {role_id: 33},
data: {role_id: 33, if_mobile: 1},
success: function (response) {
if (response.code == 1) {
var items = [];
@@ -652,7 +652,7 @@
type: 'post',
url: '/common/admin_app',
dataType: 'json',
data: {role_id: 33},
data: {role_id: 33, if_mobile: 1},
success: function (response) {
if (response.code == 1) {
var items = [];
@@ -714,7 +714,7 @@
type: 'post',
url: '/common/admin_app',
dataType: 'json',
data: {role_id: 33},
data: {role_id: 33, if_mobile: 1},
success: function (response) {
if (response.code == 1) {
var items = [];
@@ -880,6 +880,7 @@
data: {
biz_id: that.takeCar1.biz_id,
type: 1,
if_mobile: 1,
status: 1
},
success: function (response) {
@@ -935,6 +936,7 @@
data: {
biz_id: that.takeCar2.biz_id,
type: 1,
if_mobile: 1,
status: 1
},
success: function (response) {
@@ -990,6 +992,7 @@
data: {
biz_id: that.takeCar3.biz_id,
type: 1,
if_mobile: 1,
status: 1
},
success: function (response) {
@@ -1045,6 +1048,7 @@
data: {
biz_id: that.takeCar4.biz_id,
type: 1,
if_mobile: 1,
status: 1
},
success: function (response) {
+1 -1
View File
@@ -59,7 +59,7 @@ class Biz_model extends HD_Model
* @return mixed
*/
function type_ary($key = null){
$map = array('1' => '品牌店', '2' => '合伙店', '3' => '代理店', '4' => '合作店' , '5' => '联营店');
$map = array('1' => '品牌店', '2' => '合伙店', '3' => '代理店', '4' => '合作店');
if(!is_null($key)){
return $map[$key];