// +---------------------------------------------------------------------- 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; /** * Class AwardLakeDao * @package app\common\dao\user * @author xaboy * @day 2020-05-07 */ class AwardLakeDao extends BaseDao { /** * @return BaseModel * @author xaboy * @day 2020-03-30 */ protected function getModel(): string { return AwardLake::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']); }); return $query; } }