|
@@ -6,6 +6,7 @@ use bizHd\user\classes\UserClass;
|
|
|
use bizGhs\shop\classes\ShopAdminClass;
|
|
use bizGhs\shop\classes\ShopAdminClass;
|
|
|
use biz\shop\classes\ShopClass;
|
|
use biz\shop\classes\ShopClass;
|
|
|
use common\components\imgUtil;
|
|
use common\components\imgUtil;
|
|
|
|
|
+use common\components\sms;
|
|
|
use common\components\util;
|
|
use common\components\util;
|
|
|
use common\services\ImageService;
|
|
use common\services\ImageService;
|
|
|
use Yii;
|
|
use Yii;
|
|
@@ -78,15 +79,18 @@ class AdminClass extends BaseClass
|
|
|
if (!empty($adminId)) {
|
|
if (!empty($adminId)) {
|
|
|
$shopAdmin = ShopAdminClass::getByCondition(['shopId' => $shopId, 'adminId' => $adminId]);
|
|
$shopAdmin = ShopAdminClass::getByCondition(['shopId' => $shopId, 'adminId' => $adminId]);
|
|
|
if (empty($shopAdmin)) {
|
|
if (empty($shopAdmin)) {
|
|
|
- $adminData = [
|
|
|
|
|
- 'password' => password_hash($mobile, PASSWORD_BCRYPT),
|
|
|
|
|
- 'payPassword' => password_hash($mobile, PASSWORD_BCRYPT),
|
|
|
|
|
- 'mobile' => $mobile,
|
|
|
|
|
- 'currentShopId' => $shopId,
|
|
|
|
|
- 'super' => 1,
|
|
|
|
|
- 'openShop' => 3,
|
|
|
|
|
- ];
|
|
|
|
|
- self::updateById($adminId, $adminData);
|
|
|
|
|
|
|
+ $text = rand(123123, 987987);
|
|
|
|
|
+ $admin = \biz\admin\classes\AdminClass::getById($adminId, true);
|
|
|
|
|
+ if (empty($admin)) {
|
|
|
|
|
+ util::fail('没有找到员工');
|
|
|
|
|
+ }
|
|
|
|
|
+ $admin->password = password_hash($mobile, PASSWORD_BCRYPT);
|
|
|
|
|
+ $admin->payPassword = password_hash($text, PASSWORD_BCRYPT);
|
|
|
|
|
+ $admin->mobile = $mobile;
|
|
|
|
|
+ $admin->super = 1;
|
|
|
|
|
+ $admin->openShop = 3;
|
|
|
|
|
+ $admin->save();
|
|
|
|
|
+ $avatar = $admin->avatar;
|
|
|
$shopData = [
|
|
$shopData = [
|
|
|
'adminId' => $adminId,
|
|
'adminId' => $adminId,
|
|
|
'shopId' => $shopId,
|
|
'shopId' => $shopId,
|
|
@@ -94,11 +98,14 @@ class AdminClass extends BaseClass
|
|
|
'remind' => 1,
|
|
'remind' => 1,
|
|
|
'roleId' => $roleId,
|
|
'roleId' => $roleId,
|
|
|
'default' => 1,
|
|
'default' => 1,
|
|
|
|
|
+ 'avatar' => $avatar,
|
|
|
'adminName' => $adminName,
|
|
'adminName' => $adminName,
|
|
|
'super' => 1,
|
|
'super' => 1,
|
|
|
'founder' => 1,
|
|
'founder' => 1,
|
|
|
];
|
|
];
|
|
|
ShopAdminClass::add($shopData);
|
|
ShopAdminClass::add($shopData);
|
|
|
|
|
+ $url = Yii::$app->params['ghsDomain'];
|
|
|
|
|
+ sms::freeSend($mobile, "您的开店申请审核通过,地址:{$url} 帐号:{$mobile} 密码:{$text}");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|