WorkGroupChatStatisticDao.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\dao\work;
  12. use app\dao\BaseDao;
  13. use app\model\work\WorkGroupChatStatistic;
  14. use crmeb\traits\SearchDaoTrait;
  15. /**
  16. * Class WorkGroupChatStatisticDao
  17. * @package app\dao\work
  18. */
  19. class WorkGroupChatStatisticDao extends BaseDao
  20. {
  21. use SearchDaoTrait;
  22. /**
  23. * @return string
  24. */
  25. protected function setModel(): string
  26. {
  27. return WorkGroupChatStatistic::class;
  28. }
  29. /**
  30. * 获取当前统计详情
  31. * @param int $chatId
  32. * @return array|\think\Model|null
  33. * @throws \think\db\exception\DataNotFoundException
  34. * @throws \think\db\exception\DbException
  35. * @throws \think\db\exception\ModelNotFoundException
  36. */
  37. public function getToDayInfo(int $chatId)
  38. {
  39. return $this->getModel()->whereDay('create_time')->where('group_id', $chatId)->find();
  40. }
  41. }