MeetingApply.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. class MeetingApply extends Base
  6. {
  7. public function list(){
  8. $page = input('page/d',1);
  9. $size = input('size/d',10);
  10. $lists = model('MeetingApply')->lists($page,$size,$this->userId,$this->orgId);
  11. HelpHander::success($lists);
  12. }
  13. // 全部审批列表
  14. public function blist(){
  15. $title = input('title','','trim');
  16. $page = input('page/d',1);
  17. $size = input('size/d',10);
  18. $lists = model('MeetingApply')->blist($page,$size,$title,$this->userId,$this->orgId);
  19. HelpHander::success($lists);
  20. }
  21. public function search(){
  22. $title = input('title','','trim');
  23. $page = input('page/d',1);
  24. $size = input('size/d',10);
  25. $lists = model('MeetingApply')->searchs($page,$size,$title,$this->userId,$this->orgId);
  26. HelpHander::success($lists);
  27. }
  28. public function details(){
  29. $id = input('id/d',0);
  30. $info = model('MeetingApply')->details($id);
  31. HelpHander::success($info);
  32. }
  33. //审批通过
  34. public function confirm(){
  35. $id = input('id/d');
  36. $content = input('content','','trim');
  37. $serviceUserId = input('serviceUserId');
  38. // if(!$content){
  39. // HelpHander::error('审批意见不能为空');
  40. // }
  41. $ret = model('MeetingApply')->confirms($id,$content,$serviceUserId);
  42. if($ret){
  43. HelpHander::success([],'操作成功');
  44. }else{
  45. HelpHander::error(model('MeetingApply')->getError());
  46. }
  47. }
  48. //拒绝
  49. public function reject(){
  50. $id = input('id/d');
  51. $content = input('content','','trim');
  52. if(!$content){
  53. HelpHander::error('审批意见不能为空');
  54. }
  55. $ret = model('MeetingApply')->rejects($id,$content);
  56. if($ret){
  57. HelpHander::success([],'操作成功');
  58. }else{
  59. HelpHander::error(model('MeetingApply')->getError());
  60. }
  61. }
  62. //我的预定
  63. public function myReserve(){
  64. $page = input('page/d',1);
  65. $size = input('size/d',10);
  66. $ret = model('MeetingApply')->myReserves($page,$size,$this->userId,$this->orgId);
  67. HelpHander::success($ret);
  68. }
  69. //我的预定取消
  70. public function cancelReserve(){
  71. $id = input('id/d');
  72. $ret = model('MeetingApply')->cancelReserves($id);
  73. if($ret){
  74. HelpHander::success([],'预定取消');
  75. }else{
  76. HelpHander::error('取消失败');
  77. }
  78. }
  79. //我的预定详情
  80. public function reserveDetails(){
  81. $id = input('id/d',0);
  82. $ret = model('MeetingApply')->reserveDetails($id);
  83. if($ret){
  84. HelpHander::success($ret,'成功');
  85. }else{
  86. HelpHander::error('参数错误');
  87. }
  88. }
  89. //获取有会议室权限的人
  90. public function getAllWorker(){
  91. $ret = model('WorkTypeMode')->getRolesUserApp(12,$this->orgId,-1);
  92. HelpHander::success($ret);
  93. }
  94. }