123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\admin\controller\activity_area;
-
- use app\common\basics\AdminBase;
- use app\common\server\JsonServer;
- use think\facade\View;
- use app\admin\validate\activity_area\AreaValidate;
- use app\admin\logic\activity_area\AreaLogic;
- use app\admin\logic\activity_area\GoodsLogic;
-
-
- class Area extends AdminBase
- {
-
-
- public function lists()
- {
-
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $lists = AreaLogic::lists($get);
- return JsonServer::success('获取成功', $lists);
- }
- return View();
- }
-
-
-
- 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();
- }
-
-
-
- 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();
- }
-
-
-
-
- public function del()
- {
-
- $id = $this->request->post('id');
- (new AreaValidate())->goCheck('del', ['id' => $id]);
-
- return JsonServer::success('删除成功', [AreaLogic::del($id)]);
- }
-
- }
|