AwardLakeLogDao.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\common\dao\user;
  12. use app\common\dao\BaseDao;
  13. use app\common\model\BaseModel;
  14. use app\common\model\user\AwardIntegralPrice;
  15. use app\common\model\user\AwardLake;
  16. use app\common\model\user\AwardLakeLog;
  17. /**
  18. * Class AwardLakLogDao
  19. * @package app\common\dao\user
  20. * @author xaboy
  21. * @day 2020-05-07
  22. */
  23. class AwardLakeLogDao extends BaseDao
  24. {
  25. /**
  26. * @return BaseModel
  27. * @author xaboy
  28. * @day 2020-03-30
  29. */
  30. protected function getModel(): string
  31. {
  32. return AwardLakeLog::class;
  33. }
  34. public function search($where)
  35. {
  36. // return $this->getModel()::getDB()->where($where);
  37. $query = $this->getModel()::getDB()
  38. ->when(isset($where['type']) && $where['type'] !== '',function($query) use($where){
  39. $query->where('type',$where['type']);
  40. })->when(isset($where['pm']) && $where['pm'] !== '',function($query) use($where){
  41. $query->where('pm',$where['pm']);
  42. });
  43. return $query;
  44. }
  45. }