From 5022a621c4b576682d39cb6298ba0209c8d2b2b0 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 25 Aug 2023 10:57:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 77 +++++++------------ 1 file changed, 29 insertions(+), 48 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 5a430e3b..f6b75647 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -643,30 +643,7 @@ class StoreOrderRepository extends BaseRepository $order->presell_price = $order->pay_price; } } - - // 状态处理 - $order->order_status = 0; - if ($order->paid == 0) { - $order->order_status = 1; - } - if ($order->paid == 1 && $order->status == 0) { - $order->order_status = 2; - } - if ($order->status == 1) { - $order->order_status = 3; - } - if ($order->status == 2) { - $order->order_status = 4; - } - if ($order->status == 3) { - $order->order_status = 5; - } - if ($order->status == -1) { - $order->order_status = 6; - } - if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) { - $order->order_status = 7; - } + $order->order_status = $this->getOrderStatusV2($order); return $order; } @@ -1771,36 +1748,40 @@ class StoreOrderRepository extends BaseRepository } } $order->takeOrderCount = count($order['takeOrderList']); - - // 订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 8已支付 - $order->order_status = 0; - if ($order->paid == 0) { - $order->order_status = 1; - } - if ($order->paid == 1 && $order->status == 0) { - $order->order_status = 2; - } - if ($order->status == 1) { - $order->order_status = 3; - } - if ($order->status == 2) { - $order->order_status = 4; - } - if ($order->status == 3) { - $order->order_status = 5; - } - if ($order->status == -1) { - $order->order_status = 6; - } - if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) { - $order->order_status = 7; - } + $order->order_status = $this->getOrderStatusV2($order); unset($order['takeOrderList'], $order->interest); } return compact( 'count','list', 'where'); } + public function getOrderStatusV2($order) { + // 订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 + $order->order_status = 0; + if ($order->paid == 0) { + $order->order_status = 1; + } + if ($order->paid == 1 && $order->status == 0) { + $order->order_status = 2; + } + if ($order->status == 1) { + $order->order_status = 3; + } + if ($order->status == 2) { + $order->order_status = 4; + } + if ($order->status == 3) { + $order->order_status = 5; + } + if ($order->status == -1) { + $order->order_status = 6; + } + if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) { + $order->order_status = 7; + } + return $order->order_status; + } + public function userList($uid, $page, $limit) { $query = $this->dao->search([