AppMgr.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. class AppMgr extends Base
  6. {
  7. // 新增
  8. public function save(){
  9. model('AppMgr')->add();
  10. HelpHander::success([],'操作成功');
  11. }
  12. // 编辑
  13. public function update(){
  14. model('AppMgr')->add();
  15. HelpHander::success([],'操作成功');
  16. }
  17. // 详情
  18. public function detail(){
  19. $id = input('id/d',0);
  20. $ret = model('AppMgr')->info($id);
  21. HelpHander::success($ret);
  22. }
  23. // 列表
  24. public function list(){
  25. $page = input('page/d',1);
  26. $size = input('size/d',10);
  27. $type = input('type/d',10);
  28. $ret = model('AppMgr')->lists($page,$size,$type);
  29. HelpHander::success($ret);
  30. }
  31. // 删除
  32. public function del(){
  33. $id = input('id/d',0);
  34. model('AppMgr')->del($id);
  35. HelpHander::success([],'操作成功');
  36. }
  37. // 修改状态
  38. public function enableMgr(){
  39. $id = input('id/d',0);
  40. $enable = input('enable/d',0);
  41. model('AppMgr')->changeStatus($id,$enable,$this->orgId);
  42. HelpHander::success([],'操作成功');
  43. }
  44. public function newAppMgr(){
  45. $ret = model('AppMgr')->appMgr(1);
  46. HelpHander::success($ret);
  47. }
  48. public function newIosMgr(){
  49. $ret = model('AppMgr')->appMgr(2);
  50. $ret = $ret?$ret:null;
  51. HelpHander::success($ret);
  52. }
  53. }