Commit 95927ba7 by 朱继来

售后添加列

parent fab6ddfa
...@@ -43,23 +43,11 @@ class OrderServiceModel extends Model ...@@ -43,23 +43,11 @@ class OrderServiceModel extends Model
$perm = new PermController; $perm = new PermController;
$role = $perm->getUserRole($request); // 用户角色 $role = $perm->getUserRole($request); // 用户角色
$field = ['s.id', 's.service_sn', 's.order_id', 's.order_sn', 's.user_id', 's.service_type', 's.service_status', 's.refund_status', 's.return_status', 's.apply_id', 's.apply_name', 's.auditor_id', 's.auditor_name', 's.create_time', 's.auditor_time']; $field = ['s.id', 's.service_sn', 's.order_id', 's.order_sn', 's.user_id', 's.service_type', 's.service_status', 's.refund_status', 's.return_status', 's.apply_id', 's.apply_name', 's.auditor_id', 's.auditor_name', 's.create_time', 's.auditor_time', 'o.order_pay_type'];
$list = $this->from('lie_order_service as s');
if ($map['is_account_order'] !== '') {
$list = $list->join('lie_order as o', 's.order_id', '=', 'o.order_id')
->where(function($query) use($map) {
if ($map['is_account_order'] == 1) {
$query->where('o.order_pay_type', 3);
} else {
$query->where('o.order_pay_type', '<>', 3);
}
});
}
$list = $list->where(function($query) use ($map, $request, $role, $perm) { $list = $this->from('lie_order_service as s')
->join('lie_order as o', 's.order_id', '=', 'o.order_id')
->where(function($query) use ($map, $request, $role, $perm) {
// 售后单号 // 售后单号
if ($map['service_sn']) { if ($map['service_sn']) {
$query->where('s.service_sn', '=', $map['service_sn']); $query->where('s.service_sn', '=', $map['service_sn']);
...@@ -101,6 +89,12 @@ class OrderServiceModel extends Model ...@@ -101,6 +89,12 @@ class OrderServiceModel extends Model
$query->where('s.create_time', '<=', $map['end_time']); $query->where('s.create_time', '<=', $map['end_time']);
} }
if ($map['is_account_order'] == 1) {
$query->where('o.order_pay_type', 3);
} else if ($map['is_account_order'] == -1) {
$query->where('o.order_pay_type', '<>', 3);
}
switch ($role) { switch ($role) {
case 2: // 查看下级 case 2: // 查看下级
$sub_sale_ids = $perm->getSubSaleId($request->user->userId); $sub_sale_ids = $perm->getSubSaleId($request->user->userId);
...@@ -160,6 +154,8 @@ class OrderServiceModel extends Model ...@@ -160,6 +154,8 @@ class OrderServiceModel extends Model
$v['items'] = $service_items; $v['items'] = $service_items;
$v['service_amount'] = number_format($goods_amount, 2, '.', ''); $v['service_amount'] = number_format($goods_amount, 2, '.', '');
$v['is_account_order'] = $v['order_pay_type'] == 3 ? '是' : '否';
} }
return $data; return $data;
......
...@@ -27,6 +27,7 @@ layui.use(['form', 'table', 'laydate'], function(){ ...@@ -27,6 +27,7 @@ layui.use(['form', 'table', 'laydate'], function(){
,{field: 'apply_name', title: '申请人', width: 120} ,{field: 'apply_name', title: '申请人', width: 120}
,{field: 'auditor_name', title: '审核人', width: 120} ,{field: 'auditor_name', title: '审核人', width: 120}
,{field: 'service_amount', title: '售后金额', width: 120} ,{field: 'service_amount', title: '售后金额', width: 120}
,{field: 'is_account_order', title: '账期订单', width: 120}
,{field: 'service_status_val', title: '售后状态', templet: '#status', width: 120} ,{field: 'service_status_val', title: '售后状态', templet: '#status', width: 120}
,{field: 'refund_status_val', title: '退款状态', width: 120} ,{field: 'refund_status_val', title: '退款状态', width: 120}
,{field: 'return_status_val', title: '退货状态', width: 120} ,{field: 'return_status_val', title: '退货状态', width: 120}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment