edit-amdin-add_paylog and api filter brand_id =3

This commit is contained in:
lccsw
2021-09-30 15:57:45 +08:00
parent 0fd69e496c
commit 5fd89a93f1
8 changed files with 71 additions and 23 deletions
+18 -5
View File
@@ -21,6 +21,7 @@ class Orders extends HD_Controller
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_finance_model');
$this->load->model('sys/sys_finance_model');
$this->load->model('sys/sys_company_model');
$this->load->model('app/liche/app_liche_orders_model');
$this->load->library('receiver/orders_entity');
@@ -683,14 +684,20 @@ class Orders extends HD_Controller
'pay_price>' => 0
];
$count = $this->app_liche_orders_model->count($where);
if ($count) {
$rows = $this->app_liche_orders_model->select($where, 'id desc', $page, $size, 'id,total_price,type,pay_time');
if($count){
$rows = $this->app_liche_orders_model->select($where,'id desc',$page,$size,'id,total_price,type,pay_time,mch_id,descrip');
$type_arr = $this->app_liche_orders_model->get_type_arr();
foreach ($rows as $item) {
foreach($rows as $item){
$company = '';
if($item['mch_id']){
$company = $this->sys_company_model->get(['wx_mchid'=>$item['mch_id']],'short');
}
$list[] = [
'money' => $item['total_price'],
'type_cn' => $type_arr[$item['type']],
'pay_time' => $item['pay_time']
'pay_time' => $item['pay_time'],
'company' => $company ? $company['short']:'',
'descrip' => $item['descrip']
];
}
}
@@ -711,7 +718,9 @@ class Orders extends HD_Controller
$row = $this->orders_model->get(['id' => $id]);
$money = $this->input->post('money');
$pay_time = $this->input->post('pay_time');
if (!$money || !$pay_time || !$row) {
$wx_mchid = $this->input->post('wx_mchid');
$descrip = $this->input->post('descrip');
if(!$money || !$pay_time ||!$row || !$wx_mchid){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->load->helper('order');
@@ -719,6 +728,7 @@ class Orders extends HD_Controller
$data = [
'o_id' => $row['id'],
'sid' => $sid,
'mch_id' => $wx_mchid,
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
@@ -731,12 +741,15 @@ class Orders extends HD_Controller
'pay_time' => date('Y-m-d H:i:s', strtotime($pay_time)),
'c_time' => time()
];
$descrip && $data['descrip'] = $descrip;
$res = $this->app_liche_orders_model->add($data);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
$companys = $this->sys_company_model->select(['status'=>1,'wx_mchid!='=>''],'id desc','','','id,wx_mchid,short');
$this->data['companys'] = $companys;
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orders/add_paylog');
}
+19 -1
View File
@@ -8,10 +8,28 @@
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">收款公司:</label>
<div class="am-para-input w150">
<select name="wx_mchid">
<?foreach($companys as $item){?>
<option value="<?=$item['wx_mchid']?>"><?=$item['short']?></option>
<?}?>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">支付时间:</label>
<div class="am-para-input">
<input type="text" value="" id="pay_time" name="pay_time" readonly>
<input type="text" value="" id="pay_time" name="pay_time" autocomplete="off">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">备注:</label>
<div class="am-para-input">
<textarea name="descrip"></textarea>
</div>
</div>
+4
View File
@@ -8,6 +8,8 @@
<tr>
<th>付款金额</th>
<th>类型</th>
<th>收款公司</th>
<th>备注</th>
<th>付款时间</th>
</tr>
</thead>
@@ -15,6 +17,8 @@
<tr v-for="item in list">
<td>{{item.money}}</td>
<td>{{item.type_cn}}</td>
<td>{{item.company}}</td>
<td>{{item.descrip}}</td>
<td>{{item.pay_time}}</td>
</tr>
</tbody>
+8 -4
View File
@@ -241,8 +241,8 @@ class Cusorder extends Wxapp{
//订单列表头部
protected function get_tabs(){
$lists = [
['key' =>0 ,'name' => '进行中'],
['key' =>1 ,'name' => '已完成'],
['key' =>10 ,'name' => '进行中'],
['key' =>11 ,'name' => '已完成'],
];
return $lists;
}
@@ -267,15 +267,19 @@ class Cusorder extends Wxapp{
];
$group_id == 1 && $where['admin_id'] = $uid;//销售
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
if($keyword){
$where["(name='{$keyword}' or mobile='{$keyword}')"] = null;
}
if($status){ //已完成
if($status == 11){ //已完成
$where['status'] = 6;
}else{ //进行中
}elseif($status == 10 ){ //进行中
$where['status>='] = 0;
$where['status!='] = 6;
$p_row = $this->app_liche_orders_model->get(['o_id'=>$row['id'],'pid'=>0,'status>='=>0],'id');
}else{
strlen($status) && $where['status'] = $status;
}
$fileds = 'id,name,mobile,car_json,brand_id,s_id,deposit,payway,status,c_time';
$count = $this->orders_model->count($where);
+1 -1
View File
@@ -368,7 +368,7 @@ class Customers extends Wxapp{
if($group_id==1 || $ismy){
$where["admin_id"] = $uid;
}
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
if($s_time && $e_time){
$where['c_time >='] = strtotime($s_time);
$where['c_time <='] = strtotime(date('Y-m-d 23:59:59',strtotime($e_time)));
+5 -10
View File
@@ -25,22 +25,12 @@ class Statistics extends Wxapp{
protected function get_cust(){
$season = $this->input_param('season');
$city_id = $this->input_param('city_id');
//!strlen($season) && $season = ceil((date('n'))/3)-1;//当月是第几季度
//$season_data = $this->season_data($season+1);
//$days = getMonth($season+1);
!strlen($season) && $season = date('n')-1;//当前月份
$month = $season+1;
$season_data = $this->months();
$series = [];
$bizs = [];
$months_arr = [];
//foreach($days as $val){
// $months_arr[] = [
// 'cn' => date('n月',strtotime($val)),
// 's_time' => date('Y-m-01 00:00:00',strtotime($val)),
// 'e_time' => date('Y-m-t 23:59:59',strtotime($val)),
// ];
//}
$months_arr[] = [
'cn' => $season_data[$season],
's_time' => date("Y-{$month}-01 00:00:00"),
@@ -449,6 +439,7 @@ class Statistics extends Wxapp{
'status' => $key
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$count = $this->customers_model->count($where);
$count_data[] = [
'value' => $count,
@@ -461,6 +452,7 @@ class Statistics extends Wxapp{
'biz_id'=>$biz_id
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$count = $this->customers_model->count($where);
$where = [
'status>='=>0,
@@ -468,6 +460,7 @@ class Statistics extends Wxapp{
'is_top'=>1
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$top_count = $this->customers_model->count($where); //关注
$where = [
'status>='=>0,
@@ -475,6 +468,7 @@ class Statistics extends Wxapp{
"cont_time = '0000-00-00 00:00:00'"=>null
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$un_count = $this->customers_model->count($where);//未联系
$stat_data = [
'tooltip' =>[
@@ -544,6 +538,7 @@ class Statistics extends Wxapp{
'status' => $key
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$count = $this->orders_model->count($where);
$total += $count;
$count_data[] = [
+15 -1
View File
@@ -140,6 +140,7 @@ class User extends Wxapp{
'biz_id'=>$biz_id
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$wl_count = $this->customers_model->count($where);
$where = [
'status>'=>-1,
@@ -147,21 +148,29 @@ class User extends Wxapp{
'biz_id'=>$biz_id
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$gz_count = $this->customers_model->count($where);
$where = [
'status'=>0,
'biz_id'=>$biz_id
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$sign_count = $this->orders_model->count($where);
$where = [
'status'=>1,
'biz_id'=>$biz_id
];
$group_id == 1 && $where['admin_id'] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$loan_count = $this->orders_model->count($where);
//未派单客户
$unuse_count = $this->customers_model->count(['admin_id'=>0,'biz_id'=>$biz_id]);
$where = [
'admin_id' => 0,
'biz_id' => $biz_id
];
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$unuse_count = $this->customers_model->count($where);
//为创建订单客户
$where = [
'lc_receiver_customers.status'=>2,
@@ -169,6 +178,7 @@ class User extends Wxapp{
'lc_receiver_orders.id is null'=>null
];
$group_id == 1 && $where['lc_receiver_customers.admin_id'] = $uid;
$group_id == 4 && $where['lc_receiver_customers.brand_id!='] = 3; //渠道经理过滤
$uncre_count = $this->customers_model->count_order($where);
$t1 = 'lc_receiver_order_signs';
$t2 = 'lc_receiver_orders';
@@ -177,24 +187,28 @@ class User extends Wxapp{
"biz_id" => $biz_id
];
$group_id == 1 && $where["admin_id"] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$need_sign = $this->orders_model->count($where);//需要签名
$where = [
"status"=>1,
"biz_id" => $biz_id
];
$group_id == 1 && $where["admin_id"] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$loan_count = $this->orders_model->count($where);//未选择分期
$where = [
"status"=>3,
"biz_id" => $biz_id
];
$group_id == 1 && $where["admin_id"] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$bill_count = $this->orders_model->count($where);//开票相关
$where = [
"status"=>5,
"biz_id" => $biz_id
];
$group_id == 1 && $where["admin_id"] = $uid;
$group_id == 4 && $where['brand_id!='] = 3; //渠道经理过滤
$del_count = $this->orders_model->count($where);//交付确认
$deallist = [
['title'=>'需登记订单','icon'=>'icon-dengji','total'=>$uncre_count,'page'=>'/pages/order/register/index'],
+1 -1
View File
@@ -92,5 +92,5 @@ create table lc_app_liche_orders (
c_time int(10) unsigned not null default '0' comment '创建时间',
u_time timestamp null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户购车订单';
alter table lc_app_liche_orders add descrip varchar(255) not null default '' comment '备注/描述' after pay_price;