request->isAjax()) { return JsonServer::success('', ShopAdLogic::lists($this->request->get(), $this->shop_id)); } return view(); } /** * @notes 新增广告 * @return Json|View * @author lbzy * @datetime 2023-12-05 11:58:07 */ function add() { if ($this->request->isAjax()) { $result = ShopAdLogic::add(input(), $this->shop_id); if ($result) { return JsonServer::success('添加成功'); } return JsonServer::error(ShopAdLogic::getError() ? : '添加失败'); } return view('', [ 'placeList' => ShopAdEnum::getPlaceDesc(), 'terminalList' => ShopAdEnum::getTerminal(), ]); } /** * @notes 编辑广告 * @return Json|View * @author lbzy * @datetime 2023-12-05 11:58:17 */ function edit() { if ($this->request->isAjax()) { $result = ShopAdLogic::edit(input(), $this->shop_id); if ($result) { return JsonServer::success('编辑成功'); } return JsonServer::error(ShopAdLogic::getError() ? : '编辑失败'); } return view('', [ 'info' => ShopAd::where('id', input('id/d'))->where('shop_id', $this->shop_id)->findOrEmpty()->toArray(), 'placeList' => ShopAdEnum::getPlaceDesc(), 'terminalList' => ShopAdEnum::getTerminal(), ]); } /** * @notes 设置状态 * @return Json * @author lbzy * @datetime 2023-12-05 11:59:01 */ function status() { if ($this->request->isAjax()) { ShopAdLogic::status(input(), $this->shop_id); return JsonServer::success('成功'); } } /** * @notes 删除广告 * @return Json * @author lbzy * @datetime 2023-12-05 11:58:34 */ function delete() { if ($this->request->isAjax()) { ShopAdLogic::delete(input(), $this->shop_id); return JsonServer::success('成功'); } } /** * @notes 选择链接 * @return Json|View * @author lbzy * @datetime 2023-12-05 18:33:00 */ function select_link() { if ($this->request->isAjax()) { return JsonServer::success(''); } return view('', [ 'links' => ShopAdEnum::getLinkPage(), 'shopLinkPaths' => ShopAdEnum::getShopLinkPaths(), 'goodsCategoryList' => ShopGoodsCategory::where('shop_id', $this->shop_id)->where('is_show', 1)->select()->toArray(), 'select_link' => input('link/s', ''), 'getShopGoodsListPath' => ShopAdEnum::getShopGoodsListPath(), 'getShopGoodsCategoryPath' => ShopAdEnum::getShopGoodsCategoryPath(), ]); } }