shish há 4 anos atrás
pai
commit
4ba28dd225

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

@@ -26,7 +26,6 @@ class ShopController extends BaseController
     public function actionBindLsShop()
     {
         $id = Yii::$app->request->get('id');
-
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {

+ 1 - 9
app-pt/controllers/WxOpenController.php

@@ -599,15 +599,7 @@ class WxOpenController extends PublicController
         Yii::warning("---wx open data end--- \n");
     }
 
-    //平台没有绑定商家公众号时初始化一个商家 ssh 2020.2.11
-    public function actionAddMerchant()
-    {
-        AdClass::initAdd(12362);
-        $return = MerchantService::initOpenMerchant();
-        dd($return);
-    }
-
-    public function actionCheckname()
+    public function actionCheckName()
     {
         $get = Yii::$app->request->get();
         $name = isset($get['name']) ? $get['name'] : '';

+ 0 - 2
biz-ghs/apply/services/ApplyService.php

@@ -28,8 +28,6 @@ class ApplyService extends BaseService
         $apply['name'] = isset($apply['name']) ? $apply['name'] : '';
         $main = MainClass::add(['id' => null], true);
         $mainId = $main->id ?? 0;
-        $respond = [];
-        $style = $apply['style'] ?? dict::getDict('ptStyle', 'hd');
 
         $respond = MerchantService::initGhsBaseInfo($apply, $main, true);
         $shop = $respond['shop'] ?? [];

+ 11 - 10
biz-ghs/merchant/classes/ShopClass.php

@@ -10,6 +10,7 @@ use bizGhs\shop\classes\ShopAdminClass;
 use bizHd\ad\classes\AdClass;
 use bizHd\goods\classes\CategoryClass;
 use bizHd\goods\classes\GoodsSettingClass;
+use bizHd\merchant\services\SjService;
 use bizHd\saas\classes\ApplyClass;
 use common\components\dict;
 use common\components\httpUtil;
@@ -172,7 +173,7 @@ class ShopClass extends BaseClass
             $customShopId = $custom->shopId ?? 0;
             $customShop = self::getById($customShopId, true);
             if (isset($customShop->pfShopId) && !empty($customShop->pfShopId)) {
-                util::fail('这个零售店已经绑定了一个批发店');
+                util::fail('这个零售店已经绑定了批发店');
             }
             $customMobile = $customShop->mobile ?? 0;
         }
@@ -187,13 +188,21 @@ class ShopClass extends BaseClass
                 if (empty($apply)) {
                     util::fail('没有找到申请信息');
                 }
-                $respond = MerchantService::initHdBaseInfo($apply, $ghsMain, true);
+                $respond = SjService::initHdBaseInfo($apply, $ghsMain, true);
                 $customShop = $respond['shop'] ?? [];
                 if (empty($customShop)) {
                     util::fail('没有生成门店');
                 }
                 $customShopId = $customShop->id ?? 0;
             }
+        } else {
+            //商品和分类初始化
+            CategoryClass::initCategoryGoods($ghsMainId);
+            //商城和门店广告初始化
+            AdClass::initAdd($ghsMainId);
+            //商家商品配置信息
+            $setData = ['mainId' => $ghsMainId, 'riseType' => 0, 'riseAmount' => 0];
+            GoodsSettingClass::add($setData);
         }
         $customShop->mainId = $ghsMainId;
         $customShop->pfShopId = $ghsShopId;
@@ -202,14 +211,6 @@ class ShopClass extends BaseClass
         $ghsShop->lsShopId = $customShopId;
         $ghsShop->save();
 
-        //商品和分类初始化
-        CategoryClass::initCategoryGoods($ghsMainId);
-        //商城和门店广告初始化
-        AdClass::initAdd($ghsMainId);
-        //商家商品配置信息
-        $setData = ['mainId' => $ghsMainId, 'riseType' => 0, 'riseAmount' => 0];
-        GoodsSettingClass::add($setData);
-
         //允许员工登录零售店
         $staffList = ShopAdminClass::getAllByCondition(['mainId' => $ghsMainId], null, '*', null, true);
         if (!empty($staffList)) {

+ 0 - 4
biz-ghs/merchant/services/MerchantService.php

@@ -5,20 +5,16 @@ namespace bizGhs\merchant\services;
 use bizGhs\admin\classes\ApplyClass;
 use bizGhs\custom\services\CustomService;
 use bizGhs\merchant\classes\MerchantInitClass;
-use bizHd\admin\classes\AdminRoleClass;
 use bizHd\agent\classes\AgentAssetClass;
 use bizHd\auth\services\AuthService;
 use bizHd\base\services\BaseService;
-use bizGhs\merchant\classes\AdminClass;
 use bizGhs\merchant\classes\MerchantAssetClass;
 use bizGhs\merchant\classes\MerchantClass;
 use bizGhs\merchant\classes\MerchantExtendClass;
-use bizGhs\merchant\classes\ShopClass;
 use bizHd\message\services\TMessageService;
 use bizHd\saas\services\SetAuthService;
 use bizHd\saas\services\SetMealService;
 use bizHd\user\services\UserService;
-use bizHd\wx\classes\WxOpenClass;
 use bizHd\wx\services\WxMenuService;
 use common\components\business;
 use common\components\dict;

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

@@ -13,6 +13,7 @@ use biz\sj\classes\MerchantClass;
 use bizHd\goods\classes\CategoryClass;
 use bizHd\goods\classes\GoodsSettingClass;
 use bizHd\item\services\ItemService;
+use bizHd\merchant\services\SjService;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\saas\classes\ApplyExtendClass;
 use biz\sj\services\MerchantService;
@@ -79,16 +80,14 @@ class ApplyService extends BaseService
         $main = MainClass::add(['id' => null], true);
         $mainId = $main->id ?? 0;
 
-        $respond = MerchantService::initHdBaseInfo($apply, $main, true);
+        $respond = SjService::initHdBaseInfo($apply, $main, true);
         $shop = $respond['shop'] ?? [];
 
-
         //初始化员工和角色
         \bizGhs\admin\classes\AdminClass::initAdmin($apply, $mainId, $shop);
         //初始化花材
         \bizGhs\item\services\ItemService::initItem($mainId);
 
-
         return $respond;
     }
 

+ 7 - 0
biz-jd/apply/classes/ApplyClass.php

@@ -8,4 +8,11 @@ class ApplyClass extends BaseClass
 {
 
     public static $baseFile = '\bizJd\apply\models\Apply';
+
+    const STATUS_CHECKING = 1;
+    const STATUS_PASS = 2;
+    const STATUS_UN_PASS = 3;
+    const STATUS_HAS_PAY = 4;
+    const STATUS_EXPIRE = 5;
+
 }