|
|
@@ -8,6 +8,8 @@ use bizGhs\admin\classes\AdminClass;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
use bizHd\admin\classes\ShopAdminClass;
|
|
|
use bizHd\custom\classes\CustomClass as HdCustomClass;
|
|
|
+use bizHd\custom\classes\HdClass;
|
|
|
+use bizHd\merchant\classes\SjClass;
|
|
|
use bizHd\merchant\services\ShopService;
|
|
|
use bizHd\purchase\classes\PurchaseClass;
|
|
|
use bizHd\saas\services\RegionService;
|
|
|
@@ -26,6 +28,39 @@ class ShopController extends BaseController
|
|
|
|
|
|
public $guestAccess = ['all', 'gathering-img-url', 'check-shop'];
|
|
|
|
|
|
+ public function actionModifySjName()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $adminId = $this->adminId;
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ if ($adminId != 4) {
|
|
|
+ util::fail('请联系管理员修改');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ($adminId != 919) {
|
|
|
+ util::fail('请联系管理员修改');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $name = $get['name'] ?? '';
|
|
|
+ if (empty($name)) {
|
|
|
+ util::fail('请填写名称');
|
|
|
+ }
|
|
|
+ $shop = $this->shop;
|
|
|
+ $shop->merchantName = $name;
|
|
|
+ $shop->save();
|
|
|
+ $sjId = $shop->sjId;
|
|
|
+ $sj = SjClass::getById($sjId, true);
|
|
|
+ if (empty($sj)) {
|
|
|
+ util::fail('门店信息缺失呢');
|
|
|
+ }
|
|
|
+ $sj->name = $name;
|
|
|
+ $sj->save();
|
|
|
+ $fullName = $shop->shopName == '首店' ? $name : $name . ' ' . $shop->shopName;
|
|
|
+ $shopId = $shop->id;
|
|
|
+ HdClass::updateByCondition(['shopId' => $shopId], ['name' => $fullName]);
|
|
|
+ util::complete('修改成功');
|
|
|
+ }
|
|
|
+
|
|
|
//我的可以进入的门店 ssh 20230424
|
|
|
public function actionMyShop()
|
|
|
{
|
|
|
@@ -487,13 +522,13 @@ class ShopController extends BaseController
|
|
|
$id = isset($data['id']) ? $data['id'] : 0;
|
|
|
$shop = ShopClass::getById($id, true, 'id, sjId, avatar');
|
|
|
ShopService::valid($shop, $this->sjId);
|
|
|
- if(isset($data['avatar']) && $data['avatar']!='') {
|
|
|
+ if (isset($data['avatar']) && $data['avatar'] != '') {
|
|
|
$shop->avatar = $data['avatar'];
|
|
|
$re = $shop->save();
|
|
|
|
|
|
if ($re) {
|
|
|
- \bizGhs\custom\classes\CustomClass::updateByCondition(['shopId'=>$id], [
|
|
|
- 'avatar'=>$data['avatar']
|
|
|
+ \bizGhs\custom\classes\CustomClass::updateByCondition(['shopId' => $id], [
|
|
|
+ 'avatar' => $data['avatar']
|
|
|
]);
|
|
|
util::complete('头像修改完成');
|
|
|
}
|