Org.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. class Org extends Base
  6. {
  7. // 新增
  8. public function save(){
  9. model('Org')->add();
  10. HelpHander::success([],'操作成功');
  11. }
  12. // 编辑
  13. public function update(){
  14. model('Org')->add();
  15. HelpHander::success([],'操作成功');
  16. }
  17. // 详情
  18. public function selById(){
  19. $id = input('id/d',0);
  20. $ret = model('Org')->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. $ret = model('Org')->lists($page,$size);
  28. HelpHander::success($ret);
  29. }
  30. // 作废组织
  31. public function disableOrg(){
  32. $orgId = input('orgId/d',0);
  33. model('Org')->disableOrg($orgId);
  34. HelpHander::success([],'操作成功');
  35. }
  36. // 启用组织
  37. public function toEnableOrg(){
  38. $orgId = input('orgId/d',0);
  39. model('Org')->toEnableOrg($orgId);
  40. HelpHander::success([],'操作成功');
  41. }
  42. // 显示直属下级机构列表
  43. public function selByOrgId(){
  44. $id = input('id/d',0);
  45. $ret = model('Org')->selByOrgId($id);
  46. HelpHander::success($ret);
  47. }
  48. }