You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DiyDao.php 874B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare (strict_types=1);
  3. namespace app\dao\diy;
  4. use app\dao\BaseDao;
  5. use app\model\diy\Diy;
  6. /**
  7. *
  8. * Class DiyDao
  9. * @package app\dao\diy
  10. */
  11. class DiyDao extends BaseDao
  12. {
  13. /**
  14. * 设置模型
  15. * @return string
  16. */
  17. protected function setModel(): string
  18. {
  19. return Diy::class;
  20. }
  21. /**
  22. * 获取DIY列表
  23. * @param array $where
  24. * @param int $page
  25. * @param int $limit
  26. * @return array
  27. * @throws \think\db\exception\DataNotFoundException
  28. * @throws \think\db\exception\DbException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. */
  31. public function getDiyList(array $where, int $page, int $limit, array $field = ['*'])
  32. {
  33. return $this->search($where)->field($field)->where('is_del', 0)->page($page, $limit)->order('status desc,id desc')->select()->toArray();
  34. }
  35. }