|
|
@@ -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 = [
|