diff --git a/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php b/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php index 17729ad2..05657c52 100644 --- a/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php @@ -493,14 +493,6 @@ class StoreOtherOrderCreateRepository extends StoreOtherOrderRepository } else { $extend = []; } - $orderType = $orderInfo['order_type']; - if ($orderType == 0 && $pay_type == StoreGroupOrder::PAY_TYPE_CREDIT_BUY) { - throw new ValidateException('该商品不支持先货后款'); - } - if (!in_array($orderType, [0, 98, 99]) && (count($orderInfo['order']) > 1 || ($orderType != 10 && count($orderInfo['order'][0]['list']) > 1))) { - throw new ValidateException('活动商品请单独购买'); - } - $merchantCartList = $orderInfo['order']; $cartSpread = 0; $hasTake = false; @@ -737,21 +729,6 @@ class StoreOtherOrderCreateRepository extends StoreOtherOrderRepository Db::name('store_order_product_other')->insertAll($orderProduct); return $groupOrder; }); - foreach ($merchantCartList as $merchantCart) { - foreach ($merchantCart['list'] as $cart) { - if (($cart['productAttr']['stock'] - $cart['cart_num']) < (int)merchantConfig($merchantCart['mer_id'], 'mer_store_stock')) { - SwooleTaskService::merchant('notice', [ - 'type' => 'min_stock', - 'data' => [ - 'title' => '库存不足', - 'message' => $cart['product']['store_name'] . '(' . $cart['productAttr']['sku'] . ')库存不足', - 'id' => $cart['product']['product_id'] - ] - ], $merchantCart['mer_id']); - } - } - } - // Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_CREATE', 'id' => $group->group_order_id]); - return $group; + return $this->paySuccess($group); } } diff --git a/app/common/repositories/store/order/StoreOtherOrderRepository.php b/app/common/repositories/store/order/StoreOtherOrderRepository.php index 4f935036..48aa6492 100644 --- a/app/common/repositories/store/order/StoreOtherOrderRepository.php +++ b/app/common/repositories/store/order/StoreOtherOrderRepository.php @@ -334,11 +334,6 @@ class StoreOtherOrderRepository extends BaseRepository ], $order->mer_id); } - app()->make(UserRepository::class)->update($groupOrder->uid, [ - 'pay_count' => Db::raw('pay_count+' . count($groupOrder->orderList)), - 'pay_price' => Db::raw('pay_price+' . $groupOrder->pay_price), - 'svip_save_money' => Db::raw('svip_save_money+' . $svipDiscount), - ]); $this->giveIntegral($groupOrder); if (count($profitsharing)) { $storeOrderProfitsharingRepository->insertAll($profitsharing); @@ -347,12 +342,6 @@ class StoreOtherOrderRepository extends BaseRepository $storeOrderStatusRepository->batchCreateLog($orderStatus); $groupOrder->save(); }); - - Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_PAY_SUCCESS', 'id' => $groupOrder->group_order_id]); - Queue::push(SendSmsJob::class, ['tempId' => 'ADMIN_PAY_SUCCESS_CODE', 'id' => $groupOrder->group_order_id]); - Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->uid, 'type' => 'pay_money', 'inc' => $groupOrder->pay_price]); - Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->uid, 'type' => 'pay_num', 'inc' => 1]); - app()->make(UserBrokerageRepository::class)->incMemberValue($groupOrder->uid, 'member_pay_num', $groupOrder->group_order_id); } diff --git a/app/controller/api/store/order/StoreOrderOther.php b/app/controller/api/store/order/StoreOrderOther.php index 052d53e8..ab879fdc 100644 --- a/app/controller/api/store/order/StoreOrderOther.php +++ b/app/controller/api/store/order/StoreOrderOther.php @@ -16,7 +16,6 @@ namespace app\controller\api\store\order; use app\common\model\store\order\StoreGroupOrder; use app\common\repositories\delivery\DeliveryOrderRepository; -use app\common\repositories\store\order\StoreOrderCreateRepository; use app\common\repositories\store\order\StoreOtherOrderCreateRepository; use app\common\repositories\store\order\StoreOrderReceiptRepository; use app\validate\api\UserReceiptValidate; @@ -56,7 +55,7 @@ class StoreOrderOther extends BaseController $this->repository = $repository; } - public function v2CheckOrder(StoreCartRepository $cartRepository, StoreOrderCreateRepository $orderCreateRepository) + public function v2CheckOrder(StoreCartRepository $cartRepository, StoreOtherOrderCreateRepository $orderCreateRepository) { $cartId = (array)$this->request->param('cart_id', []); $addressId = (int)$this->request->param('address_id'); @@ -268,19 +267,6 @@ class StoreOrderOther extends BaseController return app('json')->success(['qrcode' => $this->repository->wxQrcode($id, $order->verify_code)]); } - /** - * 生成二维码 - */ - public function logisticsCode($id) - { - $storeInfo = Db::name('store_service')->where('uid', $this->request->uid())->find(); - if (!$storeInfo) - return app('json')->fail('商户信息有误'); - $order = $this->repository->getWhere(['order_id' => $id, 'mer_id' => $storeInfo['mer_id'], 'is_del' => 0]); - if (!$order) - return app('json')->fail('订单状态有误'); - return app('json')->success(['qrcode' => $this->repository->logisticsQrcode($id, $order->order_sn)]); - } public function del($id) {