$mobile, 'ptStyle' => 1], true); if (empty($lsShop)) { $main = MainClass::addMain(); $ret = SjService::initHdBaseInfo($apply, $main); $lsShop = $ret['shop'] ?? []; } else { $mainId = $lsShop->mainId ?? 0; $lsShop->onlyCg = 0; $lsShop->save(); $main = MainClass::getById($mainId, true); if (empty($main)) { util::fail('没有main信息21'); } } //收款码要做成不算收入 $lsShopId = $lsShop->id; $lsExt = ShopExtClass::getByCondition(['shopId' => $lsShopId], true); if (!empty($lsExt)) { $lsExt->gatherRepeat = 1; $lsExt->save(); } ApplyClass::updateById($applyId, ['status' => ApplyClass::STATUS_PASS, 'remark' => $remark]); $apply['name'] = isset($apply['name']) ? $apply['name'] : ''; //初始化或更新花材 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); $pfShop = $respond['shop'] ?? []; $lsShop->pfShopId = $pfShop->id ?? 0; $lsShop->save(); $pfShop->lsShopId = $lsShop->id ?? 0; $pfShop->save(); return $respond; } }