SystemContributionDao.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy
  6. * @day 2020-03-24
  7. *
  8. *
  9. */
  10. namespace app\common\dao\system\config;
  11. use app\common\dao\BaseDao;
  12. use app\common\model\BaseModel;
  13. use app\common\model\system\config\SystemContribution;
  14. use think\Collection;
  15. use think\db\exception\DataNotFoundException;
  16. use think\db\exception\DbException;
  17. use think\db\exception\ModelNotFoundException;
  18. use think\Model;
  19. /**
  20. * Class SystemContributionDao
  21. * @package app\common\dao\system\config
  22. * @author xaboy
  23. * @day 2020-03-27
  24. */
  25. class SystemContributionDao extends BaseDao
  26. {
  27. /**
  28. * @return BaseModel
  29. * @author xaboy
  30. * @day 2020-03-30
  31. */
  32. protected function getModel(): string
  33. {
  34. return SystemContribution::class;
  35. }
  36. /**
  37. * @return Collection
  38. * @throws DataNotFoundException
  39. * @throws DbException
  40. * @throws ModelNotFoundException
  41. * @author xaboy
  42. * @day 2020-03-31
  43. */
  44. public function all()
  45. {
  46. return SystemContribution::getDB()->select();
  47. }
  48. /**
  49. * @return int
  50. * @author xaboy
  51. * @day 2020-03-31
  52. */
  53. public function count()
  54. {
  55. return SystemContribution::getDB()->count();
  56. }
  57. }