|
|
@@ -554,9 +554,21 @@ class StoreOrderController
|
|
|
if (!$verifyCode) return app('json')->fail(410188);
|
|
|
$uid = $request->uid();
|
|
|
$orderInfo = $services->writeOffOrder($verifyCode, (int)$isConfirm, $uid);
|
|
|
+
|
|
|
if ($isConfirm == 0) {
|
|
|
return app('json')->success($orderInfo);
|
|
|
}
|
|
|
+
|
|
|
+ // 验证门店权限:只有订单选择的门店能核销这个订单
|
|
|
+ if (isset($orderInfo['store_id']) && $orderInfo['store_id'] > 0) {
|
|
|
+ /** @var SystemStoreServices $systemStoreServices */
|
|
|
+ $systemStoreServices = app()->make(SystemStoreServices::class);
|
|
|
+ $storeId = $systemStoreServices->value(['uid' => $uid], 'id');
|
|
|
+ @file_put_contents("quanju.txt", json_encode(['orderStoreId'=>$orderInfo['store_id'],'userStoreId'=>$storeId,'uid'=>$uid])."-核销门店验证\r\n", 8);
|
|
|
+ if ($storeId != $orderInfo['store_id']) {
|
|
|
+ return app('json')->fail('只能核销本门店的订单');
|
|
|
+ }
|
|
|
+ }
|
|
|
// 核销确认后,根据订单类型发放佣金 核销礼包商品和复购商品后的佣金
|
|
|
if (isset($orderInfo['order_type']) && in_array((int)$orderInfo['order_type'], [1, 2])) {
|
|
|
$orderType = (int)$orderInfo['order_type'];
|