|
|
@@ -6,6 +6,7 @@ use biz\admin\classes\AdminClass;
|
|
|
use biz\admin\classes\AdminShopClass;
|
|
|
use biz\auth\services\AuthService;
|
|
|
use biz\base\services\BaseService;
|
|
|
+use biz\merchant\classes\ShopClass;
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
use biz\user\services\UserService;
|
|
|
use common\components\error;
|
|
|
@@ -42,6 +43,11 @@ class AdminShopService extends BaseService
|
|
|
$shopId = isset($data['shopId']) ? $data['shopId'] : 0;
|
|
|
$adminId = isset($data['adminId']) ? $data['adminId'] : 0;
|
|
|
$bindData = AdminShopClass::getBindAdminData($shopId, $recommendAdminId);
|
|
|
+ $shop = ShopClass::getById($shopId);
|
|
|
+ if (empty($shop)) {
|
|
|
+ util::fail('没有找到门店');
|
|
|
+ }
|
|
|
+ $merchantId = isset($shop['merchantId']) ? $shop['merchantId'] : 0;
|
|
|
if (empty($bindData)) {
|
|
|
util::fail('请先添加管理员');
|
|
|
}
|
|
|
@@ -66,6 +72,7 @@ class AdminShopService extends BaseService
|
|
|
'roleId' => $roleId,
|
|
|
'remind' => $remind,
|
|
|
'status' => $status,
|
|
|
+ 'merchantId' => $merchantId,
|
|
|
];
|
|
|
AdminShopClass::add($addData);
|
|
|
}
|