request->isAjax()) { $get = $this->request->get(); $lists = AreaLogic::lists($get); return JsonServer::success('获取成功', $lists); } return View(); } /** * @notes 新增活动专区 * @return \think\response\Json|\think\response\View * @author suny * @date 2021/7/13 6:57 下午 */ public function add() { if ($this->request->isAjax()) { $post = $this->request->post(); $post['del'] = 0; (new AreaValidate())->goCheck('add', $post); AreaLogic::add($post); return JsonServer::success('添加成功'); } return View(); } /** * @notes 编辑活动专区 * @return \think\response\Json|\think\response\View * @author suny * @date 2021/7/13 6:57 下午 */ public function edit() { if ($this->request->isAjax()) { $post = $this->request->post(); $post['del'] = 0; $post['status'] = isset($post['status']) ? 1 : 0; (new AreaValidate())->goCheck('edit', $post); AreaLogic::edit($post); return JsonServer::success('修改成功'); } $id = $this->request->get('id'); $detail = AreaLogic::getActivityArea($id); View::assign('detail', $detail); return View(); } /** * @notes 删除活动专区 * @return \think\response\Json * @author suny * @date 2021/7/13 6:57 下午 */ public function del() { $id = $this->request->post('id'); (new AreaValidate())->goCheck('del', ['id' => $id]); return JsonServer::success('删除成功', [AreaLogic::del($id)]); } }