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