DocumentCate.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class DocumentCate extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('DocumentCate')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 编辑
  14. public function update(){
  15. model('DocumentCate')->add();
  16. HelpHander::success([],'操作成功');
  17. }
  18. // 详情
  19. public function detail(){
  20. $id = input('id/d',0);
  21. $ret = model('DocumentCate')->info($id);
  22. HelpHander::success($ret);
  23. }
  24. // 列表
  25. public function list(){
  26. $ret = model('DocumentCate')->lists($this->orgId);
  27. HelpHander::success($ret);
  28. }
  29. // 全部列表
  30. public function all(){
  31. $ret = model('DocumentCate')->all($this->orgId);
  32. HelpHander::success($ret);
  33. }
  34. // 删除
  35. public function del(){
  36. $id = input('id/d',0);
  37. model('DocumentCate')->del($id);
  38. HelpHander::success([],'操作成功');
  39. }
  40. public function queryDocumentList(){
  41. $title = input('title','','trim');
  42. $ret = model('DocumentCate')->queryDocumentList($title,$this->userId,$this->orgId);
  43. HelpHander::success($ret);
  44. }
  45. }