123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\admin\controller\kefu;
- use app\admin\logic\kefu\KefuLangLogic;
- use app\admin\logic\kefu\KefuLogic;
- use app\admin\validate\kefu\KefuLangValidate;
- use app\common\basics\AdminBase;
- use app\common\server\JsonServer;
-
-
- class KefuLang extends AdminBase
- {
-
-
- public function lists()
- {
- if($this->request->isAjax()){
- $page = $this->request->get('page', 1);
- $limit = $this->request->get('limit', 10);
- $lists = KefuLangLogic::lists($limit,$page);
- return JsonServer::success('获取成功', $lists);
- }
- return view();
- }
-
-
-
-
- public function add()
- {
- if($this->request->isAjax()){
- $post= (new KefuLangValidate())->goCheck('add');
- $result = KefuLangLogic::add($post);
- if($result){
- return JsonServer::success('新增成功', []);
- }
- return JsonServer::error('新增失败');
- }
- return view();
-
- }
-
-
-
- public function edit()
- {
- if($this->request->isAjax()){
- $post= (new KefuLangValidate())->goCheck();
- $result = KefuLangLogic::edit($post);
- if($result){
- return JsonServer::success('修改成功', []);
- }
- return JsonServer::error('修改失败');
- }
- $id = $this->request->get('id');
- return view('', [
- 'detail' => KefuLangLogic::detail($id),
- ]);
-
- }
-
-
-
- public function del()
- {
- $post= (new KefuLangValidate())->goCheck('del');
- $result = KefuLangLogic::del($post['id']);
- if($result){
- return JsonServer::success('删除成功', []);
- }
- return JsonServer::error('删除失败');
- }
- }
|