MeetingRoom.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. class MeetingRoom extends Base
  6. {
  7. // 新增
  8. public function save(){
  9. model('MeetingRoom')->add();
  10. HelpHander::success([],'操作成功');
  11. }
  12. // 编辑
  13. public function update(){
  14. model('MeetingRoom')->add();
  15. HelpHander::success([],'操作成功');
  16. }
  17. // 详情
  18. public function detail(){
  19. $id = input('id/d',0);
  20. $ret = model('MeetingRoom')->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. $title = input('title','','trim');
  28. $ret = model('MeetingRoom')->lists($page,$size,$title,$this->orgId);
  29. HelpHander::success($ret);
  30. }
  31. // 所有
  32. public function all(){
  33. $ret = model('MeetingRoom')->all($this->orgId);
  34. HelpHander::success($ret);
  35. }
  36. // 删除
  37. public function del(){
  38. $id = input('id/d',0);
  39. model('MeetingRoom')->del($id);
  40. HelpHander::success([],'操作成功');
  41. }
  42. public function books(){
  43. $page = input('page/d',1);
  44. $size = input('size/d',10);
  45. $meetingRoomId = input('meetingRoomId/d',0);
  46. $ret = model('MeetingRoom')->books($page,$size,$meetingRoomId,$this->orgId);
  47. HelpHander::success($ret);
  48. }
  49. public function curbooks(){
  50. $meetingRoomId = input('meetingRoomId/d',0);
  51. $ret = model('MeetingRoom')->curbooks($meetingRoomId,$this->orgId);
  52. HelpHander::success($ret);
  53. }
  54. // 取消会议室预定
  55. public function cancel(){
  56. $id = input('id/d',0);
  57. model('MeetingRoom')->cancel($id);
  58. HelpHander::success([],'操作成功');
  59. }
  60. }