shish hace 5 años
padre
commit
5c525e25b4

+ 1 - 2
app-hd/controllers/ProductController.php

@@ -121,7 +121,7 @@ class ProductController extends BaseController
                 $sjId = $ghs['ghsSjId'] ?? 0;
             } else {
                 $shop = ShopClass::getShopInfo($shopId);
-                $sjId = $shop['sjId'] ?? 0;
+                $sjId = $shop['merchantId'] ?? 0;
             }
         } else {
             $ghs = GhsClass::getGhsInfo($id);
@@ -148,5 +148,4 @@ class ProductController extends BaseController
         util::success($data);
     }
 
-
 }

+ 10 - 10
biz-ghs/shop/services/ShopAdminService.php

@@ -46,11 +46,11 @@ class ShopAdminService extends BaseService
         $adminId = $data['adminId'] ?? 0;
         $shopId = $data['shopId'] ?? 0;
 
-        $source = ShopAdminClass::getBindAdminData($shopId, $recommendAdminId);
-        if (empty($source)) {
+        $bindData = ShopAdminClass::getBindAdminData($shopId, $recommendAdminId);
+        if (empty($bindData)) {
             util::fail('小程序码已失效,请重新创建');
         }
-        $merchantId = $source['merchantId'] ?? 0;
+        $merchantId = $bindData['merchantId'] ?? 0;
         $shop = ShopClass::getById($shopId);
         Yii::info('merchantId:' . $merchantId . ' shopInfo:' . json_encode($shop));
         ShopClass::valid($shop, $merchantId);
@@ -59,9 +59,9 @@ class ShopAdminService extends BaseService
         if (!empty($shopAdmin)) {
             util::fail('您已经是员工');
         }
-        $name = isset($source['name']) ? $source['name'] : '';
+        $name = isset($bindData['name']) ? $bindData['name'] : '';
 
-        $roleId = $source['roleId'] ?? 0;
+        $roleId = $bindData['roleId'] ?? 0;
         $role = AdminRoleClass::getById($roleId);
         AdminRoleClass::valid($role, $merchantId);
 
@@ -72,11 +72,11 @@ class ShopAdminService extends BaseService
         if (isset($admin['subscribe']) == false || $admin['subscribe'] != 1) {
             util::fail("请关注公众号");
         }
-        $roleId = $source['roleId'];
-        $remind = isset($source['remind']) ? $source['remind'] : 0;
-        $status = isset($source['status']) ? $source['status'] : 0;
-        $password = isset($source['password']) ? password_hash($source['password'], PASSWORD_BCRYPT) : '';
-        $remark = isset($source['remark']) ? $source['remark'] : '';
+        $roleId = $bindData['roleId'];
+        $remind = isset($bindData['remind']) ? $bindData['remind'] : 0;
+        $status = isset($bindData['status']) ? $bindData['status'] : 0;
+        $password = isset($bindData['password']) ? password_hash($bindData['password'], PASSWORD_BCRYPT) : '';
+        $remark = isset($bindData['remark']) ? $bindData['remark'] : '';
         $update = ['name' => $name, 'mobile' => $mobile, 'password' => $password, 'remark' => $remark, 'currentShopId' => $shopId];
         AdminClass::updateById($adminId, $update);
         $addData = [