diff --git a/app/admin/controller/HotList.php b/app/admin/controller/HotList.php new file mode 100644 index 00000000..8ce4859b --- /dev/null +++ b/app/admin/controller/HotList.php @@ -0,0 +1,79 @@ +request->isAjax()) { + $get = $this->request->get(); + $lists = HotListLogic::lists($get); + return JsonServer::success('', $lists); + } + return view(); + } + + public function add() + { + if ($this->request->isAjax()) { + $form = $this->request->post(); + $result = HotListLogic::create($form); + if ($result['code'] == 1) { + return JsonServer::success('添加成功'); + } + return JsonServer::error($result['msg']); + } + return view(''); + } + + // 修改 + public function audit() + { + if ($this->request->isAjax()) { + $post = $this->request->post(); + $result = HotListLogic::edit($post); + if ($result['code'] == 1) { + return JsonServer::success('修改成功'); + } + return JsonServer::error($result['msg']); + } + + $id = $this->request->get('id'); + return view('', [ + 'detail' => HotListLogic::detail($id) + ]); + } + + // 删除 + public function del() + { + if ($this->request->isAjax()) { + $post = $this->request->post(); + $result = HotListLogic::del($post['id']); + if ($result) { + return JsonServer::success('删除成功'); + } + + return JsonServer::error('删除失败'); + } + } + + // 选择商品 + public function goods() + { + if ($this->request->isAjax()) { + $get = $this->request->get(); + return JsonServer::success('', GoodsLogic::lists($get)); + } + + return view(); + } +} \ No newline at end of file diff --git a/app/admin/controller/NewGoods.php b/app/admin/controller/NewGoods.php new file mode 100644 index 00000000..9911866e --- /dev/null +++ b/app/admin/controller/NewGoods.php @@ -0,0 +1,77 @@ +request->isAjax()) { + $get = $this->request->get(); + $lists = NewGoodsLogic::lists($get); + return JsonServer::success('', $lists); + } + return view(); + } + + public function add() + { + if ($this->request->isAjax()) { + $form = $this->request->post(); + $result = NewGoodsLogic::create($form); + if ($result['code'] == 1) { + return JsonServer::success('添加成功'); + } + return JsonServer::error($result['msg']); + } + return view(''); + } + + // 修改 + public function audit() + { + if ($this->request->isAjax()) { + $post = $this->request->post(); + $result = NewGoodsLogic::edit($post); + if ($result['code'] == 1) { + return JsonServer::success('修改成功'); + } + return JsonServer::error($result['msg']); + } + + $id = $this->request->get('id'); + return view('', [ + 'detail' => NewGoodsLogic::detail($id) + ]); + } + + // 删除 + public function del() + { + if ($this->request->isAjax()) { + $post = $this->request->post(); + $result = NewGoodsLogic::del($post['id']); + if ($result) { + return JsonServer::success('删除成功'); + } + + return JsonServer::error('删除失败'); + } + } + + // 选择商品 + public function goods() + { + if ($this->request->isAjax()) { + $get = $this->request->get(); + return JsonServer::success('', GoodsLogic::lists($get)); + } + + return view(); + } +} \ No newline at end of file diff --git a/app/admin/view/new_goods/add.html b/app/admin/view/new_goods/add.html new file mode 100644 index 00000000..d2976c5d --- /dev/null +++ b/app/admin/view/new_goods/add.html @@ -0,0 +1,80 @@ +{layout name="layout2" /} + + +