Rules.php 838 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. class Rules extends Base
  6. {
  7. // 新增
  8. public function save(){
  9. model('Rules')->add();
  10. HelpHander::success([],'操作成功');
  11. }
  12. // 编辑
  13. public function update(){
  14. model('Rules')->add();
  15. HelpHander::success([],'操作成功');
  16. }
  17. // 详情
  18. public function detail(){
  19. $id = input('id/d',0);
  20. $ret = model('Rules')->info($id);
  21. HelpHander::success($ret);
  22. }
  23. // 列表
  24. public function list(){
  25. $ret = model('Rules')->lists();
  26. HelpHander::success($ret);
  27. }
  28. // 获取机构管理员权限
  29. public function selectRulesByRoles(){
  30. $ret = model('Rules')->selectRulesByRoles();
  31. HelpHander::success($ret);
  32. }
  33. }