diff --git a/app/common/Enum.php b/app/common/Enum.php index c372a3c9..ff84b725 100644 --- a/app/common/Enum.php +++ b/app/common/Enum.php @@ -22,6 +22,16 @@ class Enum /** 购物车下单支付**/ const public = 10;//对公账户 + /** 订单状态 **/ + const STATUS_WAIT_DELIVERY = 0;//待发货 + const STATUS_WAIT_RECEIPT = 1;//待发货 + const STATUS_WAIT_COMMENT = 2;//待评价 + const STATUS_FINISHED = 3;//已完成 + const STATUS_GROUPING = 9;//拼团中 + const STATUS_WAIT_PAY = 10;//待付尾款 + const STATUS_TIME_OUT = 11;//尾款超时 + const STATUS_REFUNDED = -1;//已退款 + /** @const MAP */ const MAP = [ diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 826c10ad..fd1d988a 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -125,8 +125,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository ->leftJoin('store_order_product t2', 't1.order_id = t2.order_id') ->whereIn('product_id', $productIds) ->where('t1.uid', $uid) - ->where('paid', 1) - ->where('is_refund', 0) + ->where('is_del', 0) + ->where('is_system_del', 0) + ->where('status', '<>', Enum::STATUS_REFUNDED) ->count(); if ($orderRecord > 0) { throw new ValidateException('大礼包仅能购买一次');