WorkLog.php 564 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\common\model;
  3. use app\hander\HelpHander;
  4. use think\Db;
  5. use think\Model;
  6. class WorkLog extends Model
  7. {
  8. // 获取工作汇报未读数量
  9. public function unReadNums($userId,$orgId){
  10. $count = Db::name('work_daily_record')
  11. ->alias('wdr')
  12. ->join('work_daily wd','wd.id = wdr.work_daily_id')
  13. ->where('wdr.is_read',0)
  14. ->where('wdr.type',2)
  15. ->where('wdr.receive_user_id',$userId)
  16. ->where('wd.org_id',$orgId)
  17. ->count();
  18. return $count;
  19. }
  20. }