|
|
@@ -175,6 +175,36 @@ class ShopController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
+ // 更新门店头像
|
|
|
+ public function actionUpdateAvatar()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $shopId = $post['shopId'];
|
|
|
+ if ($post['shopId'] != $this->shopId or $this->mainId == 0) {
|
|
|
+ util::fail('不是您的门店');
|
|
|
+ }
|
|
|
+ $avatar = $post['avatar'];
|
|
|
+ if ($avatar == '') {
|
|
|
+ util::fail('头像地址不能为空');
|
|
|
+ }
|
|
|
+
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ $shop->avatar = $avatar;
|
|
|
+ $shop->save();
|
|
|
+
|
|
|
+ $ptStyle = $shop['ptStyle'] ?? dict::getDict('ptStyle', 'hd');
|
|
|
+ $update = ['avatar'=>$avatar];
|
|
|
+ $where = ['mainId' => $this->mainId];
|
|
|
+ if ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
|
|
|
+ GhsClass::updateByCondition($where, $update);
|
|
|
+ } else {
|
|
|
+ util::fail('门店头像更新失败,平台类型错误');
|
|
|
+ }
|
|
|
+
|
|
|
+ $shopImg = Yii::$app->params['ghsImgHost'] . $shop->avatar . "?x-oss-process=image/resize,m_fill,h_700,w_700";
|
|
|
+ util::success(['shopImg' => $shopImg], '门店头像更新成功');
|
|
|
+ }
|
|
|
+
|
|
|
//添加门店 ssh 2021.1.14
|
|
|
public function actionAdd()
|
|
|
{
|
|
|
@@ -336,7 +366,6 @@ class ShopController extends BaseController
|
|
|
//切换门店 lqh 2021.1.31
|
|
|
public function actionToggleShop()
|
|
|
{
|
|
|
-
|
|
|
$mainId = $this->mainId;
|
|
|
$adminId = $this->adminId;
|
|
|
if (getenv('YII_ENV') == 'production') {
|