|
|
@@ -5,6 +5,7 @@ namespace bizGhs\apply\services;
|
|
|
use biz\cp\services\PtCpService;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use bizGhs\apply\classes\ApplyClass;
|
|
|
+use bizGhs\item\classes\ItemClassClass;
|
|
|
use bizGhs\merchant\services\MerchantService;
|
|
|
use bizGhs\shop\classes\MainClass;
|
|
|
use bizHd\merchant\services\SjService;
|
|
|
@@ -47,7 +48,14 @@ class ApplyService extends BaseService
|
|
|
ApplyClass::updateById($applyId, ['status' => ApplyClass::STATUS_PASS, 'remark' => $remark]);
|
|
|
$apply['name'] = isset($apply['name']) ? $apply['name'] : '';
|
|
|
//初始化或更新花材
|
|
|
- MainClass::addMainInitItem($main, $live);
|
|
|
+ if (isset($apply['all']) && $apply['all'] == 1) {
|
|
|
+ MainClass::addMainInitItem($main, $live);
|
|
|
+ } else {
|
|
|
+ //单品不需要导入花材
|
|
|
+ $mainId = $main->id ?? 0;
|
|
|
+ $classData = ['mainId' => $mainId, 'name' => '默认分类', 'inTurn' => -1, 'isDefault' => 1,];
|
|
|
+ ItemClassClass::add($classData, true);
|
|
|
+ }
|
|
|
//初始化或更新产品
|
|
|
//PtCpService::initMainCp($main);
|
|
|
$respond = MerchantService::initGhsBaseInfo($apply, $main, true);
|