|
|
|
@ -203,23 +203,46 @@ class Recovery extends Controller |
|
|
|
|
*/ |
|
|
|
|
public function orderList(Request $request): Json |
|
|
|
|
{ |
|
|
|
|
$params = $request->param(); |
|
|
|
|
$filter = []; |
|
|
|
|
if(!empty($params['order_no'])) { |
|
|
|
|
$filter[] = ['order_no', 'like', "%{$params['order_no']}%"]; |
|
|
|
|
|
|
|
|
|
$server_name = $this->request->post('recovery_name'); |
|
|
|
|
$order_no = $this->request->post('order_no'); |
|
|
|
|
$order_status = intval($this->request->post('order_status')); |
|
|
|
|
$user_mobile = $this->request->post('user_mobile'); |
|
|
|
|
$where = []; |
|
|
|
|
if (!empty($server_name)) { |
|
|
|
|
$where[] = ['a.recovery_name', 'like', "%$server_name%"]; |
|
|
|
|
} |
|
|
|
|
if (!empty($params['order_status']) && $params['order_status'] != 'all') { |
|
|
|
|
$filter[] = ['order_status', '=', $params['order_status']]; |
|
|
|
|
if (!empty($order_no)) { |
|
|
|
|
$where[] = ['a.order_no', '=', $order_no]; |
|
|
|
|
} |
|
|
|
|
if ($order_status) { |
|
|
|
|
$where[] = ['a.order_status', '=', $order_status]; |
|
|
|
|
} |
|
|
|
|
if ($user_mobile) { |
|
|
|
|
$where[] = ['b.mobile', '=', $user_mobile]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$model = new RecoveryOrder(); |
|
|
|
|
$list = $model->where($filter) |
|
|
|
|
$list = $model->where($where) |
|
|
|
|
->alias('a') |
|
|
|
|
->join('user b', 'b.user_id = a.user_id') |
|
|
|
|
->field('a.*,b.mobile as user_mobile,b.nick_name as user_nick_name') |
|
|
|
|
->order('create_time', 'desc') |
|
|
|
|
->paginate(10); |
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
->paginate(15); |
|
|
|
|
$data['list'] = $list->items(); |
|
|
|
|
$data['total'] = $list->total(); |
|
|
|
|
return $this->renderSuccess($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @notes:订单详情 |
|
|
|
|
* @return Json |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function orderDetail(): Json |
|
|
|
|
{ |
|
|
|
|
$orderId = intval($this->request->post('orderId')); |
|
|
|
|
$data = RecoveryOrder::detail(['order_id' => $orderId], ['images.file', 'shop', 'user']); |
|
|
|
|
return $this->renderSuccess(['detail' => $data]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |