|
@@ -111,7 +111,7 @@ class OrderService extends BaseService
|
|
|
public function getQuery($params)
|
|
public function getQuery($params)
|
|
|
{
|
|
{
|
|
|
$where = ['a.mark' => 1];
|
|
$where = ['a.mark' => 1];
|
|
|
- return $this->model->from('orders as a')->with(['goods'])
|
|
|
|
|
|
|
+ return $this->model->from('orders as a')->with(['orderGoods','store'])
|
|
|
->leftJoin('member as b', 'b.id', '=', 'a.user_id')
|
|
->leftJoin('member as b', 'b.id', '=', 'a.user_id')
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where(function ($query) use ($params) {
|
|
->where(function ($query) use ($params) {
|
|
@@ -124,7 +124,6 @@ class OrderService extends BaseService
|
|
|
$keyword = isset($params['keyword']) ? $params['keyword'] : '';
|
|
$keyword = isset($params['keyword']) ? $params['keyword'] : '';
|
|
|
if ($keyword) {
|
|
if ($keyword) {
|
|
|
$query->where('a.order_no', 'like', "%{$keyword}%")
|
|
$query->where('a.order_no', 'like', "%{$keyword}%")
|
|
|
- ->orWhere('b.nickname', 'like', "%{$keyword}%")
|
|
|
|
|
->orWhere('b.mobile', 'like', "%{$keyword}%");
|
|
->orWhere('b.mobile', 'like', "%{$keyword}%");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -136,7 +135,7 @@ class OrderService extends BaseService
|
|
|
*/
|
|
*/
|
|
|
public function getOrderInfo($id)
|
|
public function getOrderInfo($id)
|
|
|
{
|
|
{
|
|
|
- $statusArr = [1 => '待审核', 2 => '进行中', 3 => '已完成'];
|
|
|
|
|
|
|
+ $statusArr = [1 => '待支付', 2 => '待发货', 3 => '待收货',4=>'已完成'];
|
|
|
$info = $this->model->from('orders as a')->with(['goods'])
|
|
$info = $this->model->from('orders as a')->with(['goods'])
|
|
|
->leftJoin('member as b', 'b.id', '=', 'a.user_id')
|
|
->leftJoin('member as b', 'b.id', '=', 'a.user_id')
|
|
|
->where(['a.id' => $id, 'a.mark' => 1])
|
|
->where(['a.id' => $id, 'a.mark' => 1])
|
|
@@ -151,10 +150,6 @@ class OrderService extends BaseService
|
|
|
if ($status) {
|
|
if ($status) {
|
|
|
$info['status_text'] = isset($statusArr[$status]) ? $statusArr[$status] : '';
|
|
$info['status_text'] = isset($statusArr[$status]) ? $statusArr[$status] : '';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- $info['goods'] = isset($info['goods']) && $info['goods'] ? $info['goods'] : [];
|
|
|
|
|
- $info['goods']['shipper_phone_text'] = $info['goods']['shipper_phone'] ? format_mobile($info['goods']['shipper_phone']) : '';
|
|
|
|
|
- $info['goods']['receiver_phone_text'] = $info['goods']['receiver_phone'] ? format_mobile($info['goods']['receiver_phone']) : '';
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $info;
|
|
return $info;
|