owners_623

This commit is contained in:
dengbw
2022-06-23 10:00:59 +08:00
committed by lccsw
parent f273331726
commit 392373f77c
5 changed files with 215 additions and 16 deletions
+5 -2
View File
@@ -48,7 +48,6 @@ class Customer extends HD_Controller
!$params['level'] && $params['level'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!$params['wxqy'] && $params['wxqy'] = '';
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
@@ -73,9 +72,13 @@ class Customer extends HD_Controller
if ($params['of2_id']) {
$where['of2_id'] = $params['of2_id'];
}
if (strlen($params['wxqy'])) {
$where["wxqy"] = $params['wxqy'];
} else {
$params['wxqy'] = '';
}
!$params['search_tp'] && $params['search_tp'] = 'mobile';
strlen($params['status']) && $where["status"] = $params['status'];
strlen($params['wxqy']) && $where["wxqy"] = $params['wxqy'];
if ($params['qdjl_id']) {
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
+34 -4
View File
@@ -58,6 +58,21 @@ class Owners extends HD_Controller
$u_time[0] && $where["u_time >="] = $u_time[0] . ' 00:00:00';
$u_time[1] && $where["u_time <="] = $u_time[1] . ' 23:59:59';
}
if (strlen($params['wxqy'])) {
$where["wxqy"] = $params['wxqy'];
} else {
$params['wxqy'] = '';
}
if ($params['city_id']) {
$where["city_id"] = $params['city_id'];
} else {
$params['city_id'] = '';
}
if ($params['county_id']) {
$where["county_id"] = $params['county_id'];
} else {
$params['county_id'] = '';
}
if ($params['sex']) {
$where["sex"] = $params['sex'];
} else {
@@ -80,10 +95,12 @@ class Owners extends HD_Controller
}
$count = $this->mdOwners->count($where);
$lists = [];
$wxqyAry = $this->mdOwners->wxqyAry();
if ($count) {
$this->load->model('auto/auto_brand_model', 'mdBrand');
$this->load->model('auto/auto_series_model', 'mdSeries');
$this->load->model('auto/auto_attr_model', 'mdAttr');
$this->load->model('area_model', 'mdArea');
$res = $this->mdOwners->select($where, 'id desc', $page, $size);
$str_brand_ids = implode(',', array_unique(array_column($res, 'brand_id')));
@@ -92,20 +109,26 @@ class Owners extends HD_Controller
$map_series = $this->mdSeries->map('id', 'name', ["id in({$str_s_ids})" => null]);
$str_v_ids = implode(',', array_unique(array_column($res, 'v_id')));
$map_attrs = $this->mdAttr->map('id', 'title', ["id in({$str_v_ids})" => null]);
$str_county_ids = implode(',', array_unique(array_column($res, 'county_id')));
$map_countys = $this->mdArea->map('county_id', 'city_name,county_name', ["county_id in({$str_county_ids})" => null]);
foreach ($res as $key => $val) {
if (SUPER_ADMIN == $this->role || $this->role == 35) {
$mobile_sub = $val['mobile'];
} else {
$mobile_sub = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '';
}
$sex = $car_name = '';
$sex = $car_name = $city_name = '';
if ($val['sex']) {
$sex = $val['sex'] == 1 ? '男' : '女';
}
$map_brands[$val['brand_id']] && $car_name = $map_brands[$val['brand_id']];
$map_series[$val['s_id']] && $car_name = $car_name ? $car_name . '-' . $map_series[$val['s_id']] : $map_series[$val['s_id']];
$map_attrs[$val['v_id']] && $car_name = $car_name ? $car_name . '-' . $map_attrs[$val['v_id']] : $map_attrs[$val['v_id']];
$map_countys[$val['county_id']] && $city_name = $map_countys[$val['county_id']]['city_name'] . '-' . $map_countys[$val['county_id']]['county_name'];
if (!$city_name && $val['city_id']) {
$re_are = $this->mdArea->get(['city_id' => $val['city_id']]);
$re_are && $city_name = $re_are['city_name'];
}
$lists[] = array(
'id' => $val['id'],
'name' => $val['name'],
@@ -114,6 +137,8 @@ class Owners extends HD_Controller
'sex' => $sex,
'age' => $this->getAgeByBirth($val['birth_day']),
'car_name' => $car_name,
'city_name' => $city_name,
'wxqy' => $wxqyAry[$val['wxqy']],
'car_num' => $val['car_num'],
'order_time' => $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '',
'ck_time' => $val['ck_time'] != '0000-00-00 00:00:00' ? $val['ck_time'] : '',
@@ -121,9 +146,11 @@ class Owners extends HD_Controller
);
}
}
$show_info['searchTpAry'] = $this->searchTpAry;
$show_info['wxqyAry'] = $wxqyAry;
$this->data['show_info'] = $show_info;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['searchTpAry'] = $this->searchTpAry;
$this->data['searchTimeAry'] = $this->searchTimeAry;
$this->data['params'] = $params;
$this->data['_title'] = '车主列表';
@@ -183,6 +210,8 @@ class Owners extends HD_Controller
);
}
}
$show_info['wxqyAry'] = $this->mdOwners->wxqyAry();
$this->data['show_info'] = $show_info;
$this->data['info'] = $info;
$this->data['logs'] = $logs;
$this->data['_title'] = '车主户详情';
@@ -244,7 +273,8 @@ class Owners extends HD_Controller
//更新车主信息
$ret = $this->mdOwners->update(['name' => $info['name'], 'birth_day' => $info['birth_day'], 'sex' => $info['sex'],
'brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'v_id' => $info['v_id'], 'car_num' => $info['car_num'],
'order_time' => $info['order_time'], 'ck_time' => $info['ck_time']], ['id' => $info['id']]);
'order_time' => $info['order_time'], 'ck_time' => $info['ck_time'], 'wxqy' => $info['wxqy']
, 'city_id' => $info['city_id'], 'county_id' => $info['county_id']], ['id' => $info['id']]);
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '修改车主信息失败';
+84 -2
View File
@@ -108,6 +108,44 @@
</table>
</td>
</tr>
<tr>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">所在城市:</span></td>
<td>
<div class="am-para-inline w100">
<select v-model="info.city_id">
<option value="0">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="info.county_id">
<option value="0">选择行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">企微好友:</span></td>
<td>
<div class="am-para-inline w120">
<select v-model="info.wxqy">
<option :value="i" v-for="(v,i) in show_info.wxqyAry">{{v}}</option>
</select></div>
</td>
</tr>
</table>
</td>
<td class="table-td">
</td>
</tr>
<tr>
<td>
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
@@ -279,17 +317,22 @@
data: {
edit_index: 0,
info: {},
show_info: {},
logs: [],
brandAry: [],
seryAry: [],
attrvAry: [],
goods: {"imgs_url": [], "imgs": [], "log": ''}
goods: {"imgs_url": [], "imgs": [], "log": ''},
cityAry: [],
countyAry: []
},
mounted: function () {
var that = this;
that.info = <?=json_encode($info)?>;
that.show_info = <?=json_encode($show_info)?>;
that.logs = <?=json_encode($logs)?>;
that.init_brands();
that.init_citys();
},
computed: {},
created: function () {
@@ -297,6 +340,21 @@
updated: function () {
},
methods: {
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
if (vm.info.city_id > 0) {
$.get('common/area', {id: vm.info.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
});
}
},
init_brands: function () {
var vm = this;
$.ajax({
@@ -400,6 +458,30 @@
},
},
watch: {
'info.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.info.county_id = '0';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.info.county_id > 0) {
var county_id = '0';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.info.county_id) {
county_id = county.id;
break;
}
}
that.info.county_id = county_id;
}
}
});
}
},
'info.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};
@@ -466,7 +548,7 @@
elem: '#birth_day'
, type: 'date'
, done: function (value, date) {
vue_obj.info.birth_day = value;
vue_obj.info.birth_day = value;
}
});
laydate.render({
+75 -8
View File
@@ -7,7 +7,7 @@
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp" v-model="params.search_tp">
<option :value="i" v-for="(v,i) in searchTpAry">{{v}}</option>
<option :value="i" v-for="(v,i) in show_info.searchTpAry">{{v}}</option>
</select>
</div>
</div>
@@ -26,6 +26,31 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">企微好友:</label>
<div class="am-para-inline w100">
<select name="wxqy" v-model="params.wxqy">
<option value=''>请选择</option>
<option :value="i" v-for="(v,i) in show_info.wxqyAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">所在城市:</label>
<div class="am-para-inline w100">
<select name="city_id" v-model="params.city_id">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="county_id" v-model="params.county_id">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">品牌车型:</label>
<div class="am-para-inline w100">
@@ -89,12 +114,12 @@
<thead>
<tr>
<th width="3%">ID</th>
<th width="8%"><span>车主姓名</span></th>
<th width="8%"><span>车主电话</span></th>
<th width="8%"><span>车主</span></th>
<th width="15%"><span>车辆</span></th>
<th width="8%"><span>车牌号</span></th>
<th width="5%"><span>性别</span></th>
<th width="5%"><span>年龄</span></th>
<th width="5%"><span>企微好友</span></th>
<th width="9%"><span>购车时间</span></th>
<th width="9%"><span>交付时间</span></th>
<th width="9%"><span>最后操作时间</span></th>
@@ -104,12 +129,12 @@
<template v-for="(v,i) in lists">
<tr>
<td>{{v.id}}</td>
<td>{{v.name}}</td>
<td>{{v.mobile_sub}}</td>
<td>{{v.car_name}}</td>
<td>{{v.name}}<br>{{v.mobile_sub}}</td>
<td>{{v.car_name}}<br>{{v.city_name}}</td>
<td>{{v.car_num}}</td>
<td>{{v.sex}}</td>
<td>{{v.age}}</td>
<td>{{v.wxqy}}</td>
<td>{{v.order_time}}</td>
<td>{{v.ck_time}}</td>
<td>{{v.u_time}}</td>
@@ -197,20 +222,38 @@
el: '.coms-table-wrap',
data: {
params: {},
searchTpAry: [],
lists: [],
brandAry: [],
seryAry: [],
attrvAry: [],
cityAry: [],
countyAry: [],
show_info: {searchTpAry: [], wxqyAry: []},
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.searchTpAry = <?=json_encode($searchTpAry)?>;
vm.lists = <?=json_encode($lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.init_brands();
vm.init_citys();
},
methods: {
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
if (vm.params.city_id) {
$.get('common/area', {id: vm.params.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
});
}
},
init_brands: function () {
var vm = this;
$.ajax({
@@ -269,6 +312,30 @@
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.params.county_id) {
var county_id = '';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.params.county_id) {
county_id = county.id;
break;
}
}
that.params.county_id = county_id;
}
}
});
}
},
'params.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};
@@ -27,4 +27,21 @@ class Receiver_owners_model extends HD_Model
return [1 => '正常', 0 => '禁用'];
}
/**
* Notes:企微好友状态
* Created on: 2022/5/10 10:00
* Created by: dengbw
* @param int $id
* @return array|mixed
*/
public function wxqyAry($id = '')
{
$arr = [0 => '未添加', 1 => '已添加', -1 => '删除'];
if (strlen($id)) {
return $arr[$id];
} else {
return $arr;
}
}
}