This commit is contained in:
@ -55,10 +55,28 @@ abstract class AbstractDao
|
||||
private array $queryResult;
|
||||
|
||||
/**
|
||||
* 获取模型
|
||||
* @return Model
|
||||
*/
|
||||
abstract protected function getModel(): string;
|
||||
|
||||
/**
|
||||
* 获取query selector 字段
|
||||
* @return array
|
||||
*/
|
||||
abstract public function getFields(): array;
|
||||
|
||||
/**
|
||||
* 构建查询条件.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function buildWhere(Builder $builder, array $params = []): Builder
|
||||
{
|
||||
// 根据字段查询数据库,params存在的条件进行查询
|
||||
$fields = $this->getFields();
|
||||
return self::daoBuildWhere($builder, $params, $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据操作.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user