Browse Source

Merge branch 'master' of http://git.liuniu946.com/Kirin/zccy

zxhxx 3 years ago
parent
commit
516504d32b
1 changed files with 11 additions and 0 deletions
  1. 11 0
      app/models/store/StoreOrder.php

+ 11 - 0
app/models/store/StoreOrder.php

@@ -318,6 +318,9 @@ class StoreOrder extends BaseModel
             $priceGroup = $cartGroup['priceGroup'];
             $other = $cartGroup['other'];
             $distance = 0;
+            if (!$userInfo['admin_id'] && $other['only_store_user']) {
+                return self::setErrorInfo('不支持提货!', true);
+            }
             if ($other['store_id'] != $storeId && !$store_order && !$free_check && !$test) {
                 self::clearCacheOrderInfo($uid, $key);
                 return self::setErrorInfo('所选门店改变,请刷新当前页面!', true);
@@ -526,12 +529,20 @@ class StoreOrder extends BaseModel
                 'city' => $addressInfo['city'],
                 'district' => $addressInfo['district'],
                 'time_area' => $time_area,
+                'store_user' => $other['only_store_user'],
             ];
             $orderInfo['store_id'] = SystemStore::getStoreDispose($storeId, 'id');
             if (!$orderInfo['store_id'] && !$free_check) return self::setErrorInfo('暂无门店无法选择门店!', true);
             else if ($free_check) $orderInfo['store_id'] = 0;
+            if ($other['only_store_user'] && !$orderInfo['store_id']) {
+                return self::setErrorInfo('请选择采购门店!', true);
+            }
+
             if ($orderInfo['store_id']) {
                 $store = SystemStore::get($orderInfo['store_id']);
+                if (!$store['store_user'] && $other['only_store_user']) {
+                    return self::setErrorInfo('门店不支持采购!', true);
+                }
                 $orderInfo['province'] = explode(',', $store['address'])[0] ?? '';
                 $orderInfo['city'] = explode(',', $store['address'])[1] ?? '';
                 $orderInfo['district'] = explode(',', $store['address'])[2] ?? '';