MemberCardBatchDao.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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\user\member;
  12. use app\dao\BaseDao;
  13. use app\model\user\member\MemberCardBatch;
  14. /**
  15. * Class MemberCardBatchDao
  16. * @package app\dao\user\member
  17. */
  18. class MemberCardBatchDao extends BaseDao
  19. {
  20. /** 设置模型
  21. * @return string
  22. */
  23. protected function setModel(): string
  24. {
  25. return MemberCardBatch::class;
  26. }
  27. /**
  28. * 获取会员卡批次列表
  29. * @param array $where
  30. * @param int $page
  31. * @param int $limit
  32. * @param string $order
  33. * @return array
  34. * @throws \think\db\exception\DataNotFoundException
  35. * @throws \think\db\exception\DbException
  36. * @throws \think\db\exception\ModelNotFoundException
  37. */
  38. public function getList(array $where, int $page = 0, int $limit = 0, string $order = '')
  39. {
  40. return $this->search($where)
  41. ->order(($order ? $order . ' ,' : '') . 'sort desc,id desc')
  42. ->page($page, $limit)->select()->toArray();
  43. }
  44. }