// +---------------------------------------------------------------------- namespace app\common\dao\user; use app\common\dao\BaseDao; use app\common\model\BaseModel; use app\common\model\user\AwardIntegralPrice; use app\common\model\user\AwardLake; use app\common\model\user\AwardLakeLog; /** * Class AwardLakLogDao * @package app\common\dao\user * @author xaboy * @day 2020-05-07 */ class AwardLakeLogDao extends BaseDao { /** * @return BaseModel * @author xaboy * @day 2020-03-30 */ protected function getModel(): string { return AwardLakeLog::class; } public function search($where) { // return $this->getModel()::getDB()->where($where); $query = $this->getModel()::getDB() ->when(isset($where['type']) && $where['type'] !== '',function($query) use($where){ $query->where('type',$where['type']); })->when(isset($where['pm']) && $where['pm'] !== '',function($query) use($where){ $query->where('pm',$where['pm']); }); return $query; } }