|
|
|
@ -68,11 +68,14 @@ class Order extends OrderModel |
|
|
|
|
} |
|
|
|
|
$filterOr = []; |
|
|
|
|
if (!empty($param['searchValue']) && $param['searchType'] == 'all') { |
|
|
|
|
// $filterOr = [ |
|
|
|
|
// ['order.order_no', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
// ['user.nick_name', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
// ['address.name', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
// ['address.phone', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
// ]; |
|
|
|
|
$filterOr = [ |
|
|
|
|
['order.order_no', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
['user.nick_name', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
['address.name', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
['address.phone', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
['order.order_no|user.nick_name|address.name|address.phone', 'like', "%{$param['searchValue']}%"] |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -88,7 +91,8 @@ class Order extends OrderModel |
|
|
|
|
->where($filter) |
|
|
|
|
->where('order.is_delete', '=', 0); |
|
|
|
|
if (!empty($filterOr)) { |
|
|
|
|
$query = $query->whereOr($filterOr); |
|
|
|
|
// $query = $query->whereOr($filterOr); |
|
|
|
|
$query = $query->where($filterOr); |
|
|
|
|
} |
|
|
|
|
$list = $query->order(['order.create_time' => 'desc']) |
|
|
|
|
->paginate(10); |
|
|
|
@ -191,7 +195,8 @@ class Order extends OrderModel |
|
|
|
|
$filter = [ |
|
|
|
|
['pay_status', '=', PayStatusEnum::SUCCESS], |
|
|
|
|
['delivery_status', '<>', DeliveryStatusEnum::DELIVERED], |
|
|
|
|
['order_status', 'in', [OrderStatusEnum::NORMAL, OrderStatusEnum::APPLY_CANCEL]] |
|
|
|
|
// ['order_status', 'in', [OrderStatusEnum::NORMAL, OrderStatusEnum::APPLY_CANCEL]] |
|
|
|
|
['order_status', 'in', [OrderStatusEnum::NORMAL]] |
|
|
|
|
]; |
|
|
|
|
break; |
|
|
|
|
case DataTypeEnum::RECEIPT: |
|
|
|
@ -222,7 +227,8 @@ class Order extends OrderModel |
|
|
|
|
public function updatePrice(array $data): bool |
|
|
|
|
{ |
|
|
|
|
if ($this['pay_status'] != PayStatusEnum::PENDING) { |
|
|
|
|
$this->error = '该订单不合法'; |
|
|
|
|
// $this->error = '该订单不合法'; |
|
|
|
|
$this->error = '该订单已支付,无法修改价格'; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
// 实际付款金额 |
|
|
|
|