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/3] =?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/3] =?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 = [ From cc931d495cb83c856f85d69c268dc2b5dd84bbe5 Mon Sep 17 00:00:00 2001 From: lqmac Date: Sat, 24 Feb 2024 23:18:26 +0800 Subject: [PATCH 3/3] 1 --- app/api/controller/Dealer.php | 6 +++++- app/api/model/dealer/User.php | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Dealer.php b/app/api/controller/Dealer.php index e8a5eef9..acba9bf7 100644 --- a/app/api/controller/Dealer.php +++ b/app/api/controller/Dealer.php @@ -61,6 +61,10 @@ class Dealer extends Controller */ public function center(): Json { + $dealer = $this->dealer->toArray(); + + $dealer['update_time'] = date("Y-m-d", strtotime($dealer['update_time'])); + // 获取用户头像 $this->user = UserModel::related($this->user, ['avatar']); return $this->renderSuccess([ @@ -69,7 +73,7 @@ class Dealer extends Controller // 当前用户信息 'user' => $this->user, // 分销商用户信息 - 'dealer' => $this->dealer, + 'dealer' => $dealer, // 推荐人昵称 'refereeName' => DealerUserModel::getRefereeName(), // 分销设置 diff --git a/app/api/model/dealer/User.php b/app/api/model/dealer/User.php index 1ed2c902..80e40386 100644 --- a/app/api/model/dealer/User.php +++ b/app/api/model/dealer/User.php @@ -32,7 +32,6 @@ class User extends UserModel 'is_delete', 'store_id', 'create_time', - 'update_time', ]; /**