更新
This commit is contained in:
parent
a11d58b0b8
commit
d684d0ac8e
@ -493,14 +493,6 @@ class StoreOtherOrderCreateRepository extends StoreOtherOrderRepository
|
|||||||
} else {
|
} else {
|
||||||
$extend = [];
|
$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'];
|
$merchantCartList = $orderInfo['order'];
|
||||||
$cartSpread = 0;
|
$cartSpread = 0;
|
||||||
$hasTake = false;
|
$hasTake = false;
|
||||||
@ -737,21 +729,6 @@ class StoreOtherOrderCreateRepository extends StoreOtherOrderRepository
|
|||||||
Db::name('store_order_product_other')->insertAll($orderProduct);
|
Db::name('store_order_product_other')->insertAll($orderProduct);
|
||||||
return $groupOrder;
|
return $groupOrder;
|
||||||
});
|
});
|
||||||
foreach ($merchantCartList as $merchantCart) {
|
return $this->paySuccess($group);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,11 +334,6 @@ class StoreOtherOrderRepository extends BaseRepository
|
|||||||
], $order->mer_id);
|
], $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);
|
$this->giveIntegral($groupOrder);
|
||||||
if (count($profitsharing)) {
|
if (count($profitsharing)) {
|
||||||
$storeOrderProfitsharingRepository->insertAll($profitsharing);
|
$storeOrderProfitsharingRepository->insertAll($profitsharing);
|
||||||
@ -347,12 +342,6 @@ class StoreOtherOrderRepository extends BaseRepository
|
|||||||
$storeOrderStatusRepository->batchCreateLog($orderStatus);
|
$storeOrderStatusRepository->batchCreateLog($orderStatus);
|
||||||
$groupOrder->save();
|
$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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ namespace app\controller\api\store\order;
|
|||||||
|
|
||||||
use app\common\model\store\order\StoreGroupOrder;
|
use app\common\model\store\order\StoreGroupOrder;
|
||||||
use app\common\repositories\delivery\DeliveryOrderRepository;
|
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\StoreOtherOrderCreateRepository;
|
||||||
use app\common\repositories\store\order\StoreOrderReceiptRepository;
|
use app\common\repositories\store\order\StoreOrderReceiptRepository;
|
||||||
use app\validate\api\UserReceiptValidate;
|
use app\validate\api\UserReceiptValidate;
|
||||||
@ -56,7 +55,7 @@ class StoreOrderOther extends BaseController
|
|||||||
$this->repository = $repository;
|
$this->repository = $repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function v2CheckOrder(StoreCartRepository $cartRepository, StoreOrderCreateRepository $orderCreateRepository)
|
public function v2CheckOrder(StoreCartRepository $cartRepository, StoreOtherOrderCreateRepository $orderCreateRepository)
|
||||||
{
|
{
|
||||||
$cartId = (array)$this->request->param('cart_id', []);
|
$cartId = (array)$this->request->param('cart_id', []);
|
||||||
$addressId = (int)$this->request->param('address_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)]);
|
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)
|
public function del($id)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user