Message.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class Message extends Base
  7. {
  8. // 催办
  9. public function remindAudit(){
  10. $applyId = input('applyId/d',0);
  11. model('Apply')->remindAudit($applyId,$this->userId);
  12. HelpHander::success([],'操作成功');
  13. }
  14. // pc消息提醒列表
  15. public function queryAllMessageByType(){
  16. $page = input('page/d',1);
  17. $size = input('size/d',10);
  18. $type = input('type/d',0);
  19. $status = input('status/d',-1);
  20. $context = input('context','','trim');
  21. $ret = model('Message')->lists($page,$size,$this->userId,$this->orgId,$type,$context,$status);
  22. HelpHander::success($ret);
  23. }
  24. // 消息未读数
  25. public function selUnreadNum(){
  26. $ret = model('Message')->selUnreadNum($this->userId,$this->orgId);
  27. HelpHander::success($ret);
  28. }
  29. // 标记为已读
  30. public function updataStatus(){
  31. $id = input('id/d',0);
  32. model('Message')->updataStatus($id,$this->userId);
  33. HelpHander::success([],'操作成功');
  34. }
  35. // 全部已读
  36. public function batcheUpdateStatus(){
  37. $type = input('type/d',0);
  38. model('Message')->batcheUpdateStatus($type,$this->userId);
  39. HelpHander::success([],'操作成功');
  40. }
  41. // 批量删除
  42. public function batcheDelete(){
  43. $ids = input('ids','','trim');
  44. if(!$ids){
  45. HelpHander::error('未选择要删除的数据');
  46. }
  47. model('Message')->batcheDelete($ids,$this->userId);
  48. HelpHander::success([],'操作成功');
  49. }
  50. // 系统消息通知列表
  51. public function selMessageByOrg(){
  52. $page = input('page/d',1);
  53. $size = input('size/d',10);
  54. $ret = model('Message')->selMessageByOrg($page,$size,$this->userId);
  55. HelpHander::success($ret);
  56. }
  57. // 工作提醒
  58. public function selMessageWork(){
  59. $page = input('page/d',1);
  60. $size = input('size/d',10);
  61. $ret = model('Message')->selMessageWork($page,$size,$this->userId,$this->orgId);
  62. HelpHander::success($ret);
  63. }
  64. // 工作通知
  65. public function queryWorkNotice(){
  66. $page = input('page/d',1);
  67. $size = input('size/d',10);
  68. $ret = model('Message')->queryWorkNotice($page,$size,$this->userId,$this->orgId);
  69. HelpHander::success($ret);
  70. }
  71. // 工作汇报
  72. public function selMessageReport(){
  73. $page = input('page/d',1);
  74. $size = input('size/d',10);
  75. $ret = model('Message')->selMessageReport($page,$size,$this->userId,$this->orgId);
  76. HelpHander::success($ret);
  77. }
  78. }