This commit is contained in:
小鱼开发
2024-05-29 00:29:11 +08:00
parent aaae3028f2
commit 400d469d7a
6 changed files with 106 additions and 30 deletions
+8
View File
@@ -75,6 +75,14 @@ class Common extends CI_Controller
$this->load->model('area_model');
switch ($key) {
case 'province':
if ($url == 'search') {
$province = $this->filter($this->area_model->province());
} else {
$province = $this->area_model->province();
}
$this->data = $province;
break;
case 'city':
if ($url == 'search') {
$city = $this->filter($this->area_model->city($id, $type));
+8
View File
@@ -36,6 +36,7 @@ class Clues extends HD_Controller
$statusAry = $this->clues_model->statusAry();
$params = $this->input->get();
$this->data['province_id'] = $province_id = intval($params['province_id']);
$this->data['city_id'] = $city_id = intval($params['city_id']);
$this->data['county_id'] = $county_id = intval($params['county_id']);
@@ -67,6 +68,7 @@ class Clues extends HD_Controller
}
strlen($params['status']) && $where["status"] = $params['status'];
strlen($params['status2']) && $where["status2"] = $params['status2'];
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
if ($params['cfrom_id'] || $params['cfrom_id2']) {
@@ -148,10 +150,16 @@ class Clues extends HD_Controller
}
$statusList[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
}
$map_cfrom = $this->clues_cfrom_model->map('id', 'title', array('status' => 1, 'pid' => 0), '', 0, 0, 'id, title');
$map_cfrom2 = $this->clues_cfrom_model->map('id', 'title', array('status' => 1, 'pid' => $params['cfrom_id']), '', 0, 0, 'id, title');
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['searchTpAry'] = $this->searchTpAry;
$this->data['params'] = $params;
$this->data['cfromAry'] = $map_cfrom;
$this->data['cfromAry2'] = $map_cfrom2;
$this->data['statusList'] = $statusList;
$this->data['maintainAry'] = $this->maintainAry;
$this->data['_title'] = '线索池列表';
+2 -2
View File
@@ -65,11 +65,11 @@
<label class="am-para-label">来源:</label>
<div class="am-para-input w300">
<select name="cf_id1" v-model="info.cf_id1" style="width: 45%;display: inline">
<option value="">选择来源</option>
<option value="">选择一级来源</option>
<option :value="i" v-for="(v,i) in cfromAry">{{v}}</option>
</select>
<select name="cf_id2" v-model="info.cf_id2" style="width: 45%;display: inline">
<option value="">选择来源</option>
<option value="">选择二级来源</option>
<option :value="i" v-for="(v,i) in cfromAry2">{{v}}</option>
</select>
</div>
+1 -1
View File
@@ -3,7 +3,7 @@
action="/receiver/clues/edit_adviser" id="edit-form">
<div class="am-form-group">
<label class="am-para-label">商家地址:</label>
<label class="am-para-label">门店地址:</label>
<div class="am-para-input">
<div class="am-form-inline">
<div class="am-form-group w100">
+86 -26
View File
@@ -66,38 +66,51 @@
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">所在地区:</label>
<div class="am-form-group am-para-inline w150">
<select name="city_id" v-model="city_id">
<option value="0">城市</option>
<template v-for="(v,i) in cityAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
<!--
<div class="am-form-group fl">
<label class="am-para-label w100">线索来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
<option :value="i" v-for="(v,i) in cfroms">{{v}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
<option :value="i" v-for="(v,i) in cfroms2">{{v}}</option>
</select>
</div>
</div>
-->
<div class="am-form-group">
<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-form-group am-para-inline w150">
<select name="province_id" v-model="province_id">
<option value="0">省份</option>
<template v-for="(v,i) in provinceAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="city_id" v-model="city_id">
<option value="0">城市</option>
<template v-for="(v,i) in cityAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="county_id" v-model="county_id">
<option value="0">行政区</option>
<template v-for="(v,i) in countyAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
</div>
<div class="am-form-group">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100">创建时间:</label>
@@ -214,33 +227,56 @@
vue_obj = new Vue({
el: '#search_form',
data: {
province_id:<?=$params['province_id'] ? $params['province_id'] : 0?>,
city_id:<?=$params['city_id'] ? $params['city_id'] : 0?>,
county_id:<?=$params['county_id'] ? $params['county_id'] : 0?>,
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
provinceAry: [],
cityAry: [],
countyAry: []
},
mounted: function () {
this.init_provinces();
this.init_citys();
this.init_countys();
this.cfroms = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
this.cfroms2 = <?=json_encode($cfromAry2, JSON_UNESCAPED_UNICODE)?>;
},
methods: {
init_provinces: function () {
var vm = this;
$.get('common/area', {}, function (response) {
if (response.code == 1) {
vm.provinceAry = response.data;
}
});
},
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
$.get('common/area', {id: vm.province_id, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
},
init_countys: function () {
var vm = this;
$.get('common/area', {id: vm.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
});
},
reset: function () {
var that = this;
$('#search_tp').val('mobile');
$('#title').val('');
$('#id-create-time').val('');
$('#id-en-time').val('');
that.province_id = '0';
that.city_id = '0';
that.county_id = '0';
that.cfrom_id = 0;
@@ -248,6 +284,30 @@
}
},
watch: {
'province_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cityAry = [];
that.city_id = '0';
} else {
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
that.cityAry = response.data;
if (that.city_id > 0) {
var city_id = '0';
for (var i in that.cityAry) {
var city = that.city[i];
if (city.id == that.city_id) {
city_id = city.id;
break;
}
}
that.city_id = city_id;
}
}
});
}
},
'city_id': function (nv, ov) {
var that = this;
if (nv == '') {
@@ -278,14 +338,14 @@
that.cfrom_id2 = 0;
that.cfroms2 = [];
} else {
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
$.post('/receiver/clues/json_map_cfrom', {pid: nv, status: 1}, function (result) {
that.cfroms2 = result.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
for (var i in that.cfroms2) {
var cfroms2 = that.cfroms2[i];
if (cfroms2.id == that.cfrom_id2) {
cfrom_id2 = cfroms2.id;
break;
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ class User extends Wxapp
*/
protected function get_ukey()
{
$mobile_white = ['18350451617'];
$mobile_white = ['18350451617','13850003412'];
$code = $this->input_param('code');
$mobile = $this->input_param('mobile');
$sms_code = $this->input_param('sms_code');