Notice.php 923 B

12345678910111213141516171819202122232425262728293031323334353637
  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 Notice extends Base
  7. {
  8. public function lists(){
  9. $page = input('page',1);
  10. $size = input('size',20);
  11. $ret = model('Notice')->lists($page,$size,$this->userId,$this->orgId);
  12. $ret?HelpHander::success($ret):HelpHander::success(null);
  13. }
  14. public function details(){
  15. $id = input('id',0);
  16. $info = model('Notice')->details($id);
  17. if($info){
  18. HelpHander::success($info);
  19. }else{
  20. HelpHander::error('暂无数据');
  21. }
  22. }
  23. public function queryNoticeCount(){
  24. $ret = Db::name('notice')
  25. ->where('org_id',$this->orgId)
  26. ->where('user_id',$this->userId)
  27. ->where('is_read',0)
  28. ->where('del',0)
  29. ->count();
  30. HelpHander::success($ret);
  31. }
  32. }