request->param('business_line', PayConstants::BUSINESS_WECHAT); $showAppSet = false; if ($this->group < 3) { $showAppSet = true; } $adminId = 0; if ($this->request->isPost()) { $params = $this->request->post("row/a"); if (empty($params['goods_id'])) { $this->error('请添加一个商品'); } $goodsIds = $params['goods_id']; $default = $params['default'] ?? ''; try { GoodsService::instance()->saveChannelGoodsList($goodsIds, $adminId, $businessLine, $default); } catch (Exception $e) { $this->error($e->getMessage()); } $this->success('操作成功'); } $customGoodsList = GoodsService::instance()->getCustomGoodsList($adminId); $this->assignconfig('customGoodsList', json_encode($customGoodsList)); $this->assignconfig('business_line', $businessLine); $this->assign('business_line', $businessLine); $this->assign('show_app_set', $showAppSet); return $this->fetch(); } }