add-api-licheb-cal

This commit is contained in:
lccsw
2021-07-26 10:41:48 +08:00
parent 420de55115
commit 95acbe3dc6
11 changed files with 240 additions and 55 deletions
+14 -14
View File
@@ -1,26 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['bucket'] = 'img-haodian';
$config['region'] = '华';
$config['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['bucket'] = 'img-liche';
$config['region'] = '华';
$config['is_https'] = 'https';
$config['domain'] = 'qimg.haodian.cn';
$config['domain'] = 'img.liche.cn';
$config['attch'] = 'liche/';
$config['img']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['img']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['img']['bucket'] = 'img-haodian';
$config['img']['region'] = '华';
$config['img']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['img']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['img']['bucket'] = 'img-liche';
$config['img']['region'] = '华';
$config['img']['is_https'] = 'https';
$config['img']['domain'] = 'qimg.haodian.cn';
$config['img']['domain'] = 'img.liche.cn';
$config['img']['attch'] = 'liche/';
$config['video']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['video']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['video']['bucket'] = 'video-haodian';
$config['video']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['video']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['video']['bucket'] = 'media-liche';
$config['video']['region'] = '华南';
$config['video']['is_https'] = 'https';
$config['video']['domain'] = 'qv.haodian.cn';
$config['video']['domain'] = 'media.liche.cn';
$config['video']['attch'] = 'liche/';
+23 -5
View File
@@ -1335,11 +1335,29 @@ class Common extends CI_Controller
*/
public function items()
{
$select_id = $this->input->post('select_id');
$brand_id = $this->input->post('brand_id');
$s_id = $this->input->post('s_id');
$v_id = $this->input->post('v_id');
$cor_id = $this->input->post('cor_id');
$incor_id = $this->input->post('incor_id');
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$where = [
'status' => 1
];
$where = "status=1 ";
$brand_id && $where.=" and brand_id=$brand_id";
$s_id && $where.=" and s_id=$s_id";
$v_id && $where.=" and v_id=$v_id";
$cor_id && $where.=" and cor_id=$cor_id";
$incor_id && $where.=" and incor_id=$incor_id";
if($select_id){
$fhwhere = [
"($where) or (id=$select_id)" => null
];
}else{
$fhwhere = [
"($where)" => null
];
}
$count = 0;
$list = array();
@@ -1348,9 +1366,9 @@ class Common extends CI_Controller
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
$count = $this->items_model->count($where);
$count = $this->items_model->count($fhwhere);
if ($count) {
$rows = $this->items_model->select($where, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin');
$rows = $this->items_model->select($fhwhere, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin');
//品牌车型
$brand_arr = array_unique(array_column($rows, 'brand_id'));
+1 -1
View File
@@ -4,7 +4,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Member extends HD_Controller{
private $groups = [1=>'销售',2=>'店长',3=>'掌柜'];
private $groups = [1=>'销售',2=>'店长',3=>'老板'];
public function __construct()
{
+44 -1
View File
@@ -102,18 +102,56 @@
carslist: [],
page: [],
bx_imgs:[],
brand_list:[],
series_list:[],
v_list:[],
cor_list:[],
incor_list:[],
brand_id:'',
s_id:'',
v_id:'',
cor_id:'',
incor_id:''
},
mounted() {
var that = this;
that.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>;
that.brand_id = <?=$info['brand_id']?>,
that.s_id = <?=$info['s_id']?>,
that.v_id = <?=$info['v_id']?>,
that.cor_id = <?=$info['cor_id']?>,
that.incor_id = <?=$info['incor_id']?>,
that.bx_imgs = <?=json_encode($info['bx_imgs'])?>;
},
computed: {},
created: function () {
},
methods: {
setauto: function(type){
var that = this
var p_data = {'tp':1,'type':type}
if(type==2){
p_data['pid'] = that.brand_id
} else if(type==3){
p_data['pid'] = that.s_id
}
$.get("/common/auto",p_data,function(result){
if(type==1){
that.brand_list = result.data
}else if(type==2){
that.series_list = result.data
}else if(type==3){
that.v_list = result.data[3]
that.cor_list = result.data[4]
that.incor_list = result.data[5]
}
})
},
carModal: function () {
var that = this
that.setauto(1);
that.setauto(2);
that.setauto(3);
that.getCars(1);
layer.open({
type: 1,
@@ -143,7 +181,12 @@
dataType: 'json',
data: {
page: page,
select_id:vm.info.item_id
select_id:vm.info.item_id,
brand_id:vm.brand_id,
s_id:vm.s_id,
v_id:vm.v_id,
cor_id:vm.cor_id,
incor_id:vm.incor_id
},
success: function (re) {
var carslist = re.data.list;
+66
View File
@@ -123,6 +123,72 @@
</div>
<div id="car-modal" style="display: none;">
<div class="modal-body">
<form class="form-search coms-table-hd clearfix no-border" action="">
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] != -99 ? $params['status_pid'] : '' ?>">
<input type="hidden" name="status_id" value="<?= $params['status_id'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label" style="width:auto">品牌:</label>
<div class="am-para-inline w80">
<select v-model="brand_id">
<option v-for="item in brand_list" :value="item.id">
{{item.name}}
</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label" style="width:auto">车系:</label>
<div class="am-para-inline w80">
<select v-model="s_id">
<option value="0">全部</option>
<option v-for="item in series_list" :value="item.id">
{{item.name}}
</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label" style="width:auto">车辆级别:</label>
<div class="am-para-inline w80">
<select v-model="v_id">
<option value="0">全部</option>
<option v-for="item in v_list" :value="item.id">
{{item.name}}
</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label" style="width:auto">车身颜色:</label>
<div class="am-para-inline w80">
<select v-model="cor_id">
<option value="0">全部</option>
<option v-for="item in cor_list" :value="item.id">
{{item.name}}
</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label" style="width:auto">内饰颜色:</label>
<div class="am-para-inline w80">
<select v-model="incor_id">
<option value="0">全部</option>
<option v-for="item in incor_list" :value="item.id">
{{item.name}}
</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-form-group fl ml5">
<a href="javascript:;" @click="carModal" class="am-btn am-btn-success am-btn-sm w100">搜索</a>
</div>
</div>
</div>
</form>
<table class="am-table">
<thead>
<tr>
+15 -15
View File
@@ -1,26 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['bucket'] = 'img-haodian';
$config['region'] = '华';
$config['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['bucket'] = 'img-liche';
$config['region'] = '华';
$config['is_https'] = 'https';
$config['domain'] = 'qimg.haodian.cn';
$config['domain'] = 'img.liche.cn';
$config['attch'] = 'liche/';
$config['img']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['img']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['img']['bucket'] = 'img-haodian';
$config['img']['region'] = '华';
$config['img']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['img']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['img']['bucket'] = 'img-liche';
$config['img']['region'] = '华';
$config['img']['is_https'] = 'https';
$config['img']['domain'] = 'qimg.haodian.cn';
$config['img']['domain'] = 'img.liche.cn';
$config['img']['attch'] = 'liche/';
$config['video']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['video']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['video']['bucket'] = 'video-haodian';
$config['video']['region'] = '华';
$config['video']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['video']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['video']['bucket'] = 'media-liche';
$config['video']['region'] = '华';
$config['video']['is_https'] = 'https';
$config['video']['domain'] = 'qv.haodian.cn';
$config['video']['domain'] = 'media.liche.cn';
$config['video']['attch'] = 'liche/';
+3 -1
View File
@@ -168,7 +168,9 @@ class Contract extends Wxapp{
if($result){
$this->ckcars_model->update(['status'=>2],['o_id'=>$id]);
$this->orders_model->update(['status'=>3],['id'=>$id]);
$this->bills_model->add(['o_id'=>$id,'c_time'=>time()]);
if(!$this->bills_model->count(['o_id'=>$id])){
$this->bills_model->add(['o_id'=>$id,'c_time'=>time()]);
}
throw new Exception('签名成功', API_CODE_SUCCESS);
}else{
throw new Exception('签名失败', API_CODE_INVILD_PARAM);
@@ -285,6 +285,13 @@ class Customers extends Wxapp{
$where['c_time <='] = strtotime(date('Y-m-d 23:59:59',strtotime($e_time)));
}
if(strlen($iscall)){
if($iscall){
$where['cont_time!='] = '0000-00-00 00:00:00';
}else{
$where['cont_time'] = '0000-00-00 00:00:00';
}
}
$unuse && $where['admin_id'] = 0;
strlen($istop) && $where['is_top'] = $istop;
strlen($if_driver) && $where['if_driver'] = 1;
+22 -3
View File
@@ -102,20 +102,39 @@ class User extends Wxapp{
protected function get_cal(){
$uid = $this->session['uid'];
$biz_id = $this->session['biz_id'];
$group_id = $this->session['group_id'];
$this->load->model('receiver/receiver_customers_model','customers_model');
$this->load->model('receiver/order/receiver_orders_model','orders_model');
$wl_count = $this->customers_model->count(['status'=>0,'admin_id'=>$uid]);
$gz_count = $this->customers_model->count(['status>-1'=>null,'is_top'=>1,'admin_id'=>$uid]);
$this->load->model('receiver/order/receiver_order_signs_model','order_signs_model');
$wl_count = $this->customers_model->count(["cont_time = '0000-00-00 00:00:00'"=>null,'admin_id'=>$uid]);
$gz_count = $this->customers_model->count(['status>'=>-1,'is_top'=>1,'admin_id'=>$uid]);
$sign_count = $this->orders_model->count(['status'=>0,'admin_id'=>$uid]);
$loan_count = $this->orders_model->count(['status'=>1,'admin_id'=>$uid]);
//未派单客户
$unuse_count = $this->customers_model->count(['admin_id'=>0,'biz_id'=>$biz_id]);
//为创建订单客户
$uncre_count = $this->customers_model->count_order(['lc_receiver_orders.id is null'=>null,'lc_receiver_customers.admin_id'=>$uid]);
$t1 = 'lc_receiver_order_signs';
$t2 = 'lc_receiver_orders';
$need_sign = $this->order_signs_model->count_order(["$t1.status"=>0,"$t2.admin_id"=>$uid]);//需要签名
$loan_count = $this->orders_model->count(['status'=>1,'admin_id'=>$uid]);//未选择分期
$bill_count = $this->orders_model->count(['status'=>3,'admin_id'=>$uid]);//开票相关
$del_count = $this->orders_model->count(['status'=>5,'admin_id'=>$uid]);//交付确认
$deallist = [
['title'=>'需登记订单','icon'=>'icon-dengji','total'=>$uncre_count,'page'=>'/pages/order/register/index'],
['title'=>'需邀请签名','icon'=>'icon-qianming1','total'=>$need_sign,'page'=>'/pages/order/filterList/index?key=0'],
['title'=>'未选择分期','icon'=>'icon-fenpei','total'=>$loan_count,'page'=>'/pages/order/filterList/index?key=1'],
['title'=>'开票相关','icon'=>'icon-kaipiao1','total'=>$bill_count,'page'=>'/pages/order/filterList/index?key=3'],
['title'=>'交付确认','icon'=>'icon-jiaofu','total'=>$del_count,'page'=>'/pages/order/filterList/index?key=5'],
];
$data = [
'wl_count' => $wl_count,
'gz_count' => $gz_count,
'sign_count' => $sign_count,
'loan_count' => $loan_count,
'unuse_count' => $unuse_count
'unuse_count' => $unuse_count,
'deallist' => $deallist
];
return $data;
}
@@ -41,4 +41,34 @@ class Receiver_customers_model extends HD_Model
public function get_status(){
return $this->status_arr;
}
public function count_order($where){
return $this->select_order($where,'','','','',1);
}
public function select_order($where = array(), $order = '', $page = 0, $page_size = 20 , $fileds = '', $count = 0){
!$fileds && $fileds = 'lc_receiver_customers.*';
$this->db->distinct()->select($fileds);
$this->db->from('lc_receiver_customers');
$this->db->join('lc_receiver_orders', 'lc_receiver_orders.rid = lc_receiver_customers.id','left');
if ($where) {
$this->db->where($where);
}
if ($count) {
return $this->db->count_all_results();
}
if ($order) {
$this->db->order_by($order);
}
if ($page) {
$offset = ($page - 1) * $page_size;
$limit = $page_size;
} else {
$offset = null;
$limit = null;
}
$this->db->limit($limit, $offset);
return $this->db->get()->result_array();
}
}
+15 -15
View File
@@ -1,26 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['bucket'] = 'img-haodian';
$config['region'] = '华';
$config['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['bucket'] = 'img-liche';
$config['region'] = '华';
$config['is_https'] = 'https';
$config['domain'] = 'qimg.haodian.cn';
$config['domain'] = 'img.liche.cn';
$config['attch'] = 'liche/';
$config['img']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['img']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['img']['bucket'] = 'img-haodian';
$config['img']['region'] = '华';
$config['img']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['img']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['img']['bucket'] = 'img-liche';
$config['img']['region'] = '华';
$config['img']['is_https'] = 'https';
$config['img']['domain'] = 'qimg.haodian.cn';
$config['img']['domain'] = 'img.liche.cn';
$config['img']['attch'] = 'liche/';
$config['video']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['video']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['video']['bucket'] = 'video-haodian';
$config['video']['region'] = '华';
$config['video']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['video']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['video']['bucket'] = 'media-liche';
$config['video']['region'] = '华';
$config['video']['is_https'] = 'https';
$config['video']['domain'] = 'qv.haodian.cn';
$config['video']['domain'] = 'media.liche.cn';
$config['video']['attch'] = 'liche/';