// +---------------------------------------------------------------------- namespace app\common\dao\openapi; use app\common\model\openapi\OpenAuth; use app\common\dao\BaseDao; class OpenAuthDao extends BaseDao { protected function getModel(): string { return OpenAuth::class; } public function search(array $where) { $query = $this->getModel()::getDB() ->when(isset($where['type']) && $where['type'] !== '',function($query) use($where){ $query->where('type',$where['type']); }) ->when(isset($where['mer_id']) && $where['mer_id'] !== '',function($query) use($where){ $query->where('mer_id',$where['mer_id']); }); $query->order('create_time DESC'); return $query; } }