CutterApplyService.php 987 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\extra\service\cutter;
  3. use app\extra\basic\Service;
  4. use app\extra\dao\cutter\CutterApplyDao;
  5. class CutterApplyService extends Service
  6. {
  7. /**
  8. * 设置模型
  9. * @return string
  10. */
  11. public function __construct()
  12. {
  13. $this->dao = new CutterApplyDao();
  14. }
  15. /**
  16. * 列表
  17. * @param array $param
  18. */
  19. public function getList(array $param = [],string $field = '*', int $page = 0,int $limit = 0,string $order = 'id desc')
  20. {
  21. $list = $this->dao->getList($this->searchFilter($param),$field,$page,$limit,$order);
  22. $count = $this->dao->count($this->searchFilter($param));
  23. return compact('list','count');
  24. }
  25. protected function searchFilter(array $param = []): array
  26. {
  27. $filter = [];
  28. !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
  29. !empty($param['is_del']) && $filter[] = ["is_del", '=', $param['is_del']];
  30. return $filter;
  31. }
  32. }