edit-liche-clues_cfrom
This commit is contained in:
@@ -1356,6 +1356,45 @@ class Common extends CI_Controller
|
||||
$this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
/**
|
||||
* Notes:选择品牌
|
||||
*/
|
||||
public function brands()
|
||||
{
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
|
||||
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
|
||||
|
||||
$use_items_list = $this->input->post('use_items_list');
|
||||
$title = $this->input->post('title');
|
||||
$status = intval($this->input->post('status'));
|
||||
$itemsChecked = $itemsList = $resItems = array();
|
||||
if ($use_items_list) {
|
||||
foreach ($use_items_list as $key => $value) {
|
||||
$itemsChecked[$value['id']] = $value['id'];
|
||||
}
|
||||
}
|
||||
$where = [];
|
||||
$status && $where['status'] = $status;
|
||||
$title && $where['name like "%' . $title . '%"'] = null;
|
||||
$count = $this->auto_brand_model->count($where);
|
||||
$itemsList = [];
|
||||
if ($count) {
|
||||
$lists = $this->auto_brand_model->select($where, 'id desc', $page, $size);
|
||||
foreach ($lists as $key => $val) {
|
||||
$itemsList[] = [
|
||||
'id' => $val['id'],
|
||||
'name' => $val['name'],
|
||||
'is_checked' => $itemsChecked[$val['id']] ? 1 : 0
|
||||
];
|
||||
}
|
||||
}
|
||||
$this->data['itemsList'] = $itemsList;
|
||||
$hasNext = ceil($count / $size) > $page ? 1 : 0;
|
||||
$this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:车型库
|
||||
|
||||
@@ -17,6 +17,7 @@ class Cms extends HD_Controller
|
||||
parent::__construct();
|
||||
$this->load->model('app/liche/App_liche_cms_model', 'liche_cms_model');
|
||||
$this->load->model('app/App_model', 'appM');
|
||||
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
|
||||
$this->pos_arr = $this->liche_cms_model->get_position(true);
|
||||
}
|
||||
|
||||
@@ -70,6 +71,7 @@ class Cms extends HD_Controller
|
||||
$row['btn_type'] = $json['btn_type'] ? $json['btn_type'] : 1;
|
||||
$row['bg_img'] = $json['bg_img'] ? $json['bg_img'] : '';
|
||||
$row['bg_img_src'] = $json['bg_img'] ? build_qiniu_image_url($json['bg_img']) : '';
|
||||
$row['cfrom_id'] = $json['cfrom_id'] ? $json['cfrom_id']:0;
|
||||
$row['link'] = $row['url'];
|
||||
$row['s_time'] = date('Y-m-d H:i:s', $row['s_time']);
|
||||
$row['e_time'] = date('Y-m-d H:i:s', $row['e_time']);
|
||||
@@ -77,12 +79,13 @@ class Cms extends HD_Controller
|
||||
$title = "编辑{$row['title']}";
|
||||
|
||||
} else {
|
||||
$row = array('position' => '', 'type' => 1,'btn_type'=>1);
|
||||
$row = array('position' => '', 'type' => 1,'btn_type'=>1,'cfrom_id' => 0);
|
||||
$opration = 'add';
|
||||
$title = '添加推送信息';
|
||||
$covers = array();
|
||||
}
|
||||
//列表
|
||||
$this->data['cfroms'] = $this->clues_cfrom_model->select(['status'=>1],'id desc','','','id,title');
|
||||
$this->data['app_id'] = 3;
|
||||
$this->data['info'] = $row;
|
||||
$this->data['pos_arr'] = $this->pos_arr;
|
||||
@@ -121,6 +124,7 @@ class Cms extends HD_Controller
|
||||
];
|
||||
|
||||
$json = array();
|
||||
$input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id'];
|
||||
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
|
||||
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
|
||||
if($json){
|
||||
@@ -153,6 +157,7 @@ class Cms extends HD_Controller
|
||||
$input['link'] = $input['link'] . trim($input['param']);
|
||||
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
|
||||
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
|
||||
$input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id'];
|
||||
$upd = [
|
||||
'title' => $input['title'] ? $input['title'] : '',
|
||||
'url' => $input['link'] ? $input['link'] : '',
|
||||
@@ -197,12 +202,10 @@ class Cms extends HD_Controller
|
||||
|
||||
public function get_car(){
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$id = $this->input->post('id');
|
||||
$row = $this->auto_series_model->get(['id'=>$id]);
|
||||
$b_row = $this->auto_brand_model->get(['id'=>$row['brand_id']]);
|
||||
$row = $this->auto_brand_model->get(['id'=>$id]);
|
||||
$info['id'] = $row['id'];
|
||||
$info['title'] = $b_row['name'].$row['name'];
|
||||
$info['title'] = $row['name'];
|
||||
$info['img'] = '/img/visits/add.jpg';
|
||||
$this->data['data'] = $info;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">推送位置:</label>
|
||||
<div class="am-para-inline wp60" style="width : 20%">
|
||||
<div class="am-para-inline wp60" style="width:20%">
|
||||
<select name="position" v-model="info.position">
|
||||
<option value="">请选择</option>
|
||||
<template v-for="(v,i) in positions">
|
||||
@@ -43,6 +43,17 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" v-if="info.position == 2">
|
||||
<label class="am-para-label">线索来源:</label>
|
||||
<div class="am-para-input wp60" style="width:20%">
|
||||
<select name="cfrom_id" v-model="info.cfrom_id">
|
||||
<option value=0>请选择</option>
|
||||
<template v-for="(v,i) in cfroms">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" v-if="info.position >2 && info.position<8">
|
||||
<label class="am-para-label">链接类型:</label>
|
||||
<div class="am-para-input pt5">
|
||||
@@ -119,10 +130,10 @@
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="35%" style="font-weight: bold;padding-left: 8px;">车型</td>
|
||||
<td width="35%" style="padding-right: 8px;"><label class="sr-only" for="search">搜车系</label>
|
||||
<td width="35%" style="padding-right: 8px;"><label class="sr-only" for="search">搜品牌</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" style="font-size: 1.2rem;font-weight: bold;"
|
||||
v-model='itemsTitle' placeholder="车系名">
|
||||
v-model='itemsTitle' placeholder="品牌名">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" @click='getItems(1);' class="btn btn-default">搜</button>
|
||||
</div>
|
||||
@@ -134,18 +145,15 @@
|
||||
<table class="table table-middle">
|
||||
<colgroup>
|
||||
<col width="50%"/>
|
||||
<col width="30%"/>
|
||||
<col width="20%"/>
|
||||
<col width="50%"/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>车系</th>
|
||||
<th>品牌</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
<tr v-for="(b,i) in itemsList">
|
||||
<td>{{b.name}}</td>
|
||||
<td>{{b.b_name}}</td>
|
||||
<td>
|
||||
<a v-if="b.is_checked==0" href="javascript:void(0);" @click="setItems(i,1)"
|
||||
class="btn btn-primary btn-sm">选择</a>
|
||||
@@ -280,7 +288,7 @@
|
||||
}
|
||||
console.dir(select_list)
|
||||
$.ajax({
|
||||
url: '/common/cars',
|
||||
url: '/common/brands',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
@@ -304,7 +312,7 @@
|
||||
vm.itemsList[index]['is_checked'] = checked;
|
||||
var _items = {
|
||||
id: vm.itemsList[index]['id'],
|
||||
title: vm.itemsList[index]['b_name']+vm.itemsList[index]['name'],
|
||||
title: vm.itemsList[index]['name'],
|
||||
img : '/img/visits/add.jpg'
|
||||
};
|
||||
vm.select = _items;
|
||||
@@ -347,6 +355,7 @@
|
||||
areas:[],
|
||||
covers:[],
|
||||
app_id:0,
|
||||
cfroms:[],
|
||||
},
|
||||
mounted: function(){
|
||||
var that = this;
|
||||
@@ -355,6 +364,7 @@
|
||||
that.areas = <?=json_encode($area_arr, JSON_UNESCAPED_UNICODE)?>;
|
||||
that.covers = <?=json_encode($covers, JSON_UNESCAPED_UNICODE)?>;
|
||||
that.app_id = <?=$app_id?>;
|
||||
that.cfroms = <?=$cfroms ? json_encode($cfroms,JSON_UNESCAPED_UNICODE): []?>;
|
||||
},
|
||||
methods: {
|
||||
saveEdit: function () {
|
||||
|
||||
@@ -115,22 +115,26 @@ class Aptinfo extends Wxapp{
|
||||
protected function post(){
|
||||
$cf_id = 1;
|
||||
$this->load->model('receiver/receiver_clues_model','clues_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
|
||||
$uid = $this->session['uid'];
|
||||
$biz_id = $this->input_param('biz_id');
|
||||
$series_id = $this->input_param('car_id');//车系id
|
||||
$city_code = $this->input_param('city_id');
|
||||
$recommend_id = intval($this->input_param('cf_uid')); //来源用户id
|
||||
$cms_id = intval($this->input_param('cms_id')); //cmsid
|
||||
|
||||
$series_row = $this->auto_series_model->get(['id'=>$series_id]);
|
||||
$cms_row = $this->cms_model->get(['id'=>$cms_id]);
|
||||
if($cms_row){
|
||||
$cms_json = json_decode($cms_row['jsondata'],true);
|
||||
$cms_json['cfrom_id'] && $cf_id = $cms_json['cfrom_id'];
|
||||
$brand_row = $this->auto_brand_model->get(['id'=>$cms_row['target_id']]);
|
||||
}
|
||||
$row = $this->clues_model->get(['cf_id'=>$cf_id,'cf_uid'=>$uid,'app_id'=>$this->app_id,'status'=>0]);
|
||||
if($row){
|
||||
$update = [
|
||||
'en_time' => date('Y-m-d H:i:s')
|
||||
];
|
||||
$series_row['brand_id'] && $update['brand_id'] = $series_row['brand_id'];
|
||||
$series_row['id'] && $update['s_id'] = $series_row['id'];
|
||||
$brand_row && $update['brand_id'] = $brand_row['id'];
|
||||
$this->clues_model->update($update,['id'=>$row['id']]);
|
||||
throw new Exception('预约成功', API_CODE_SUCCESS);
|
||||
}
|
||||
@@ -154,8 +158,7 @@ class Aptinfo extends Wxapp{
|
||||
];
|
||||
|
||||
$recommend_id && $add_data['recommend_id'] = $recommend_id;
|
||||
$series_row['brand_id'] && $add_data['brand_id'] = $series_row['brand_id'];
|
||||
$series_row['id'] && $add_data['s_id'] = $series_row['id'];
|
||||
$brand_row['id'] && $add_data['brand_id'] = $brand_row['id'];
|
||||
$this->clues_model->add($add_data);
|
||||
throw new Exception('预约成功', API_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ class Cusorder extends Wxapp{
|
||||
'id' => $id,
|
||||
'name' => $row['name'],
|
||||
'mobile' => mobile_asterisk($row['mobile']),
|
||||
'admin_img' => 'https://img.liche.cn/liche/2021/07/7725fc9ab0dc0ba1/f3c84cf3b805bac4.png',
|
||||
'admin_img' => 'https://img.liche.cn/liche/2021/08/7725fc9ab0dc0ba1/f3c84cf3b805bac4.png',
|
||||
'payway' => $row['payway'],
|
||||
'car_data' => $car_data,
|
||||
'loan_status' => $loan_status,
|
||||
|
||||
Reference in New Issue
Block a user