shish 5 лет назад
Родитель
Сommit
e3124c4e36

+ 0 - 1
biz-ghs/admin/classes/AdminClass.php

@@ -446,7 +446,6 @@ class AdminClass extends BaseClass
 			util::fail("您没有权限");
 		}
 		$adminId = $admin['id'];
-		$currentShopId = $admin['currentShopId'] ?? 0;
 		$sjShopList = ShopClass::getSjShopList($sjId);
 		$sjShopIds = array_column($sjShopList, 'id');
 		if (in_array($toggleShopId, $sjShopIds) == false) {

+ 5 - 0
biz-ghs/order/classes/OrderClass.php

@@ -118,6 +118,11 @@ class OrderClass extends BaseClass
             ProductClass::decreaseStock($val['productId'], $val['bigNum'], $val['smallNum']);
         }
 
+        //自取订单直接完成
+        if ($data['sendType'] == self::SEND_TYPE_NO) {
+            OrderClass::withoutSend($return);
+        }
+
         return $return;
     }
 

+ 111 - 109
biz/shop/classes/ShopAdminClass.php

@@ -9,114 +9,116 @@ use biz\base\classes\BaseClass;
 
 class ShopAdminClass extends BaseClass
 {
-	
-	public static $baseFile = '\biz\shop\models\ShopAdmin';
-	
-	const GENERATE_ADMIN_DATA = 'generate_admin_data_';//创建管理员需要的数据
-	
-	//添加客户 shish 2021.3.1
-	public static function addShopAdmin($data)
-	{
-		return self::add($data);
-	}
-	
-	//创建管理准备数据key shish 2020.4.17
-	public static function getGenerateAdminDataKey($shopId, $adminId)
-	{
-		return self::GENERATE_ADMIN_DATA . $shopId . '_' . $adminId;
-	}
-	
-	//创建管理员数据准备 shish 2020.4.17
-	public static function prepareBindAdmin($data)
-	{
-		$adminId = $data['adminId'];
-		$shopId = $data['shopId'];
-		$cacheKey = self::getGenerateAdminDataKey($shopId, $adminId);
-		$params = [$cacheKey];
-		if (!empty($data)) {
-			foreach ($data as $key => $val) {
-				if (!is_array($val)) {
-					$params[] = $key;
-					$params[] = $val;
-				}
-			}
-		}
-		Yii::$app->redis->executeCommand('HMSET', $params);
-	}
-	
-	//获取创建管理员需要的信息 shish 2020.4.20
-	public static function getBindAdminData($shopId, $adminId)
-	{
-		$cacheKey = self::getGenerateAdminDataKey($shopId, $adminId);
-		$cacheData = Yii::$app->redis->executeCommand('HGETALL', [$cacheKey]);
-		$data = [];
-		if (!empty($cacheData)) {
-			$data = [];
-			$list = [];
-			$x = 0;
-			foreach ($cacheData as $cKey => $cVal) {
-				if ($cKey % 2 == 0) {
-					$list[$x]['key'] = $cVal;
-				} else {
-					$list[$x]['value'] = $cVal;
-					$x++;
-				}
-			}
-			foreach ($list as $lKey => $lVal) {
-				$data[$lVal['key']] = $lVal['value'];
-			}
-		}
-		return $data;
-	}
-	
-	//删除创建管理员需要的信息 shish 2020.4.20
-	public static function delBindAdminData($shopId, $adminId)
-	{
-		$cacheKey = self::getGenerateAdminDataKey($shopId, $adminId);
-		$keyNameList = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
-		if (!empty($keyNameList)) {
-			$data = array_merge([$cacheKey], $keyNameList);
-			$cacheData = Yii::$app->redis->executeCommand('HDEL', $data);
-		}
-	}
-	
-	//取店长 shish 2021.1.8
-	public static function getManager($shopId)
-	{
-		$relate = self::getByCondition(['shopId' => $shopId]);
-		$adminId = isset($relate['adminId']) ? $relate['adminId'] : 0;
-		$info = [];
-		if (!empty($adminId)) {
-			$info = AdminClass::getById($adminId);
-		}
-		return $info;
-	}
-	
-	public static function valid($adminInfo, $merchantId)
-	{
-		if (isset($adminInfo['merchantId']) && $adminInfo['merchantId'] == $merchantId) {
-			return true;
-		}
-		util::fail('此员工您没有权限操作');
-	}
-	
-	//切换门店时增加员工关系 shish 2021.3.1
-	public static function toggleShopAddRelate($originShopAdmin, $toggleShopId)
-	{
-		$adminId = $originShopAdmin['adminId'];
-		$roleId = $originShopAdmin['roleId'];
-		$sjId = $originShopAdmin['merchantId'];
-		$has = self::getCount(['shopId' => $toggleShopId, 'adminId' => $adminId, 'delStatus' => 0]);
-		if ($has) {
-			return $has;
-		}
-		$data = [
-			'roleId' => $roleId,
-			'adminId' => $adminId,
-			'shopId' => $toggleShopId,
-			'merchantId' => $sjId,
-		];
-		return self::addShopAdmin($data);
-	}
+
+    public static $baseFile = '\biz\shop\models\ShopAdmin';
+
+    const GENERATE_ADMIN_DATA = 'generate_admin_data_';//创建管理员需要的数据
+
+    //添加客户 shish 2021.3.1
+    public static function addShopAdmin($data)
+    {
+        return self::add($data);
+    }
+
+    //创建管理准备数据key shish 2020.4.17
+    public static function getGenerateAdminDataKey($shopId, $adminId)
+    {
+        return self::GENERATE_ADMIN_DATA . $shopId . '_' . $adminId;
+    }
+
+    //创建管理员数据准备 shish 2020.4.17
+    public static function prepareBindAdmin($data)
+    {
+        $adminId = $data['adminId'];
+        $shopId = $data['shopId'];
+        $cacheKey = self::getGenerateAdminDataKey($shopId, $adminId);
+        $params = [$cacheKey];
+        if (!empty($data)) {
+            foreach ($data as $key => $val) {
+                if (!is_array($val)) {
+                    $params[] = $key;
+                    $params[] = $val;
+                }
+            }
+        }
+        Yii::$app->redis->executeCommand('HMSET', $params);
+    }
+
+    //获取创建管理员需要的信息 shish 2020.4.20
+    public static function getBindAdminData($shopId, $adminId)
+    {
+        $cacheKey = self::getGenerateAdminDataKey($shopId, $adminId);
+        $cacheData = Yii::$app->redis->executeCommand('HGETALL', [$cacheKey]);
+        $data = [];
+        if (!empty($cacheData)) {
+            $data = [];
+            $list = [];
+            $x = 0;
+            foreach ($cacheData as $cKey => $cVal) {
+                if ($cKey % 2 == 0) {
+                    $list[$x]['key'] = $cVal;
+                } else {
+                    $list[$x]['value'] = $cVal;
+                    $x++;
+                }
+            }
+            foreach ($list as $lKey => $lVal) {
+                $data[$lVal['key']] = $lVal['value'];
+            }
+        }
+        return $data;
+    }
+
+    //删除创建管理员需要的信息 shish 2020.4.20
+    public static function delBindAdminData($shopId, $adminId)
+    {
+        $cacheKey = self::getGenerateAdminDataKey($shopId, $adminId);
+        $keyNameList = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
+        if (!empty($keyNameList)) {
+            $data = array_merge([$cacheKey], $keyNameList);
+            $cacheData = Yii::$app->redis->executeCommand('HDEL', $data);
+        }
+    }
+
+    //取店长 shish 2021.1.8
+    public static function getManager($shopId)
+    {
+        $relate = self::getByCondition(['shopId' => $shopId]);
+        $adminId = isset($relate['adminId']) ? $relate['adminId'] : 0;
+        $info = [];
+        if (!empty($adminId)) {
+            $info = AdminClass::getById($adminId);
+        }
+        return $info;
+    }
+
+    public static function valid($adminInfo, $merchantId)
+    {
+        if (isset($adminInfo['merchantId']) && $adminInfo['merchantId'] == $merchantId) {
+            return true;
+        }
+        util::fail('此员工您没有权限操作');
+    }
+
+    //切换门店时增加员工关系 shish 2021.3.1
+    public static function toggleShopAddRelate($originShopAdmin, $toggleShopId)
+    {
+        $adminId = $originShopAdmin['adminId'];
+        $roleId = $originShopAdmin['roleId'];
+        $sjId = $originShopAdmin['merchantId'];
+        $super = $originShopAdmin['super'] ?? 0;
+        $has = self::getCount(['shopId' => $toggleShopId, 'adminId' => $adminId, 'delStatus' => 0]);
+        if ($has) {
+            return $has;
+        }
+        $data = [
+            'roleId' => $roleId,
+            'adminId' => $adminId,
+            'shopId' => $toggleShopId,
+            'merchantId' => $sjId,
+            'super' => $super
+        ];
+        return self::addShopAdmin($data);
+    }
 
 }