|
|
@@ -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)) {
|