shish 5 年之前
父節點
當前提交
d85f214a8a

+ 0 - 2
app-ghs/controllers/BaseController.php

@@ -89,8 +89,6 @@ class BaseController extends PublicController
                 $sjExtend = MerchantExtendService::getByMerchantId($sjId);
                 $this->sjExtend = $sjExtend;
             }
-
-
         }
         return parent::beforeAction($action);
     }

+ 2 - 0
app-ghs/controllers/ConsoleController.php

@@ -15,6 +15,8 @@ use common\components\util;
 class ConsoleController extends BaseController
 {
 
+    public $guestAccess = ['init'];
+
     //概况 ssh 2019.12.19
     public function actionProfile()
     {

+ 2 - 0
app-ghs/controllers/MerchantController.php

@@ -13,6 +13,8 @@ use common\components\util;
 class MerchantController extends BaseController
 {
 
+    public $guestAccess = ['detail'];
+
     //运费设置 ssh 2019.12.8
     public function actionFreightSetting()
     {

+ 3 - 1
app-ghs/controllers/ShopController.php

@@ -17,6 +17,8 @@ use yii\web\UrlManager;
 class ShopController extends BaseController
 {
 
+    public $guestAccess = ['all'];
+
     //获取当前门店信息 ssh 2021.3.27
     public function actionCurrentShop()
     {
@@ -153,7 +155,7 @@ class ShopController extends BaseController
     {
         $res = [];
         $shopAdmin = $this->shopAdmin;
-        if ($shopAdmin['super'] == 1) {
+        if (isset($shopAdmin['super']) && $shopAdmin['super'] == 1) {
             $res = ShopClass::getAllShop($this->sjId);
         }
         util::success($res);

+ 9 - 9
app-hd/controllers/ApplyController.php

@@ -40,15 +40,15 @@ class ApplyController extends BaseController
     //申请试用 ssh 2020.1.11
     public function actionRegister()
     {
-        $get = Yii::$app->request->get();
+        $post = Yii::$app->request->post();
         $admin = $this->admin;
-        $get['adminId'] = $this->adminId;
-        $get['adminName'] = $admin['adminName'] ?? '';
-        $get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
-        $get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
-        $get['from'] = ApplyClass::FROM_RETAIL;
-        $get['style'] = SjClass::STYLE_RETAIL;
-        $name = $get['name'] ?? '';
+        $post['adminId'] = $this->adminId;
+        $post['adminName'] = $admin['adminName'] ?? '';
+        $post['long'] = isset($post['longitude']) ? $post['longitude'] : '';
+        $post['lat'] = isset($post['latitude']) ? $post['latitude'] : '';
+        $post['from'] = ApplyClass::FROM_RETAIL;
+        $post['style'] = SjClass::STYLE_RETAIL;
+        $name = $post['name'] ?? '';
         if (empty($name)) {
             util::fail('名称不能为空');
         }
@@ -60,7 +60,7 @@ class ApplyController extends BaseController
         $transaction = $connection->beginTransaction();
         try {
             //增加或更新申请
-            ApplyService::replaceRetail($get);
+            ApplyService::replaceRetail($post);
             $transaction->commit();
         } catch (\Exception $exception) {
             $transaction->rollBack();

+ 2 - 0
app-hd/controllers/ConsoleController.php

@@ -14,6 +14,8 @@ use common\components\util;
 class ConsoleController extends BaseController
 {
 
+    public $guestAccess = ['init'];
+
     //概况 ssh 2019.12.19
     public function actionProfile()
     {

+ 3 - 1
app-hd/controllers/ShopController.php

@@ -13,6 +13,8 @@ use Yii;
 class ShopController extends BaseController
 {
 
+    public $guestAccess = ['all'];
+
     //门店列表 ssh 20202.2.29
     public function actionList()
     {
@@ -179,7 +181,7 @@ class ShopController extends BaseController
     {
         $res = [];
         $shopAdmin = $this->shopAdmin;
-        if ($shopAdmin['super'] == 1) {
+        if (isset($shopAdmin['super']) && $shopAdmin['super'] == 1) {
             $res = ShopClass::getAllShop($this->sjId);
         }
         util::success($res);

+ 9 - 3
biz-hd/saas/services/ApplyService.php

@@ -115,7 +115,7 @@ class ApplyService extends BaseService
         //查询客户提交的证件
         $has = ApplyClass::getByCondition(['licenseNo' => $licenseNo]);
         if (!empty($has)) {
-            util::fail('营业执照已经使用过');
+            util::fail('营业执照已用过');
         }
         $has = ApplyClass::getByCondition(['mobile' => $mobile]);
         if (!empty($has)) {
@@ -127,7 +127,7 @@ class ApplyService extends BaseService
         }
         $has = ApplyClass::getByCondition(['adminId' => $adminId]);
         if (!empty($has)) {
-            util::fail('您的微信已经申请过');
+            util::fail('您已经申请过');
         }
         $from = $data['from'] ?? 0;
         if (in_array($from, [ApplyClass::FROM_GHS, ApplyClass::FROM_RETAIL]) == false) {
@@ -153,8 +153,14 @@ class ApplyService extends BaseService
         $licenseNo = $data['licenseNo'] ?? '';
         $has = ApplyClass::getByCondition(['licenseNo' => $licenseNo]);
         if (!empty($has)) {
-            util::fail('您已申请');
+            util::fail('营业执照已用过');
         }
+        $adminId = $data['adminId'];
+        $has = ApplyClass::getByCondition(['adminId' => $adminId]);
+        if (!empty($has)) {
+            util::fail('您已经申请过');
+        }
+
         //引荐的员工
         $shopAdminId = $data['shopAdminId'] ?? 0;
         if (!empty($shopAdminId)) {

+ 2 - 1
sql.sql

@@ -2083,4 +2083,5 @@ ALTER TABLE xhGhsOrder ADD `sendTime` DATETIME NOT NULL DEFAULT '0000-00-00 00:0
 ALTER TABLE xhGhsOrder ADD `sendTimeWant` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'  COMMENT '客户要求的发货时间' AFTER `sendTime`;
 ALTER TABLE xhOrderExpress DROP COLUMN `sendTime`;
 ALTER TABLE xhOrderExpress ADD `sendTime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'  COMMENT '实际配送时间' AFTER `tip`;
-ALTER TABLE xhOrderExpress ADD `sendTimeWant` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'  COMMENT '客户要求的发货时间' AFTER `sendTime`;
+ALTER TABLE xhOrderExpress ADD `sendTimeWant` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'  COMMENT '客户要求的发货时间' AFTER `sendTime`;
+ALTER TABLE xhApply CHANGE `avatar` `logo` VARCHAR(800) NOT NULL DEFAULT '' COMMENT '商家头像';