From c922d3fee3503e32a391dbb5cbbbef92fc917e63 Mon Sep 17 00:00:00 2001 From: "674780036@qq.com" <674780036@qq.com> Date: Sat, 24 Feb 2024 22:24:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/model/Order.php | 43 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/app/api/model/Order.php b/app/api/model/Order.php index 520bdca1..5f51376a 100644 --- a/app/api/model/Order.php +++ b/app/api/model/Order.php @@ -249,25 +249,60 @@ class Order extends OrderModel switch ($dataType) { case 'all': break; - case 'payment': + // case 'payment': + // $filter[] = ['pay_status', '=', PayStatusEnum::PENDING]; + // $filter[] = ['order_status', '=', OrderStatusEnum::NORMAL]; + // break; + //待付款 + case 'pay': $filter[] = ['pay_status', '=', PayStatusEnum::PENDING]; $filter[] = ['order_status', '=', OrderStatusEnum::NORMAL]; - break; + break; + //待发货 case 'delivery': $filter = [ ['pay_status', '=', PayStatusEnum::SUCCESS], ['delivery_status', '<>', DeliveryStatusEnum::DELIVERED], ['order_status', 'in', [OrderStatusEnum::NORMAL, OrderStatusEnum::APPLY_CANCEL]] ]; - break; - case 'received': + break; + //待收货 + case 'receipt': $filter = [ ['pay_status', '=', PayStatusEnum::SUCCESS], ['delivery_status', '=', DeliveryStatusEnum::DELIVERED], ['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED], ['order_status', '=', OrderStatusEnum::NORMAL] ]; + break; + //待收货 + // case 'received': + // $filter = [ + // ['pay_status', '=', PayStatusEnum::SUCCESS], + // ['delivery_status', '=', DeliveryStatusEnum::DELIVERED], + // ['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED], + // ['order_status', '=', OrderStatusEnum::NORMAL] + // ]; + // break; + //已完成 + case 'complete': + $filter = [ + ['order_status', '=', OrderStatusEnum::COMPLETED] + ]; + break; + //待取消 + case 'apply_cancel': + $filter = [ + ['order_status', '=', OrderStatusEnum::APPLY_CANCEL] + ]; + break; + //已取消 + case 'cancel': + $filter = [ + ['order_status', '=', OrderStatusEnum::CANCELLED] + ]; break; + //已评价 case 'comment': $filter = [ ['is_comment', '=', 0], From 414624f592cd74c3c2f31ad7a995b395245211f5 Mon Sep 17 00:00:00 2001 From: "674780036@qq.com" <674780036@qq.com> Date: Sat, 24 Feb 2024 22:46:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/model/Order.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/api/model/Order.php b/app/api/model/Order.php index 5f51376a..f87d8e7f 100644 --- a/app/api/model/Order.php +++ b/app/api/model/Order.php @@ -249,10 +249,10 @@ class Order extends OrderModel switch ($dataType) { case 'all': break; - // case 'payment': - // $filter[] = ['pay_status', '=', PayStatusEnum::PENDING]; - // $filter[] = ['order_status', '=', OrderStatusEnum::NORMAL]; - // break; + case 'payment': + $filter[] = ['pay_status', '=', PayStatusEnum::PENDING]; + $filter[] = ['order_status', '=', OrderStatusEnum::NORMAL]; + break; //待付款 case 'pay': $filter[] = ['pay_status', '=', PayStatusEnum::PENDING]; @@ -276,14 +276,14 @@ class Order extends OrderModel ]; break; //待收货 - // case 'received': - // $filter = [ - // ['pay_status', '=', PayStatusEnum::SUCCESS], - // ['delivery_status', '=', DeliveryStatusEnum::DELIVERED], - // ['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED], - // ['order_status', '=', OrderStatusEnum::NORMAL] - // ]; - // break; + case 'received': + $filter = [ + ['pay_status', '=', PayStatusEnum::SUCCESS], + ['delivery_status', '=', DeliveryStatusEnum::DELIVERED], + ['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED], + ['order_status', '=', OrderStatusEnum::NORMAL] + ]; + break; //已完成 case 'complete': $filter = [