增加基础配置
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-12 11:59:33 +08:00
parent fb50096e66
commit 8a3ab17b25
44 changed files with 1599 additions and 66 deletions

View File

@ -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);
}
/**
* 数据操作.
*/

View File

@ -35,4 +35,9 @@ class CompanyDao extends AbstractDao
{
return Company::class;
}
public function getFields(): array
{
return [];
}
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Author: ykxiao
* Date: 2025/7/10
* Time: 下午8:59
* Description:
*
* (c) ykxiao <yk_9001@hotmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
declare(strict_types=1);
namespace App\Dao\Company;
use App\Dao\AbstractDao;
use App\Model\CompanyModules;
class CompanyModulesDao extends AbstractDao
{
public function getModel(): string
{
return CompanyModules::class;
}
public function getFields(): array
{
return [];
}
}

View File

@ -35,4 +35,9 @@ class PurchaseDao extends AbstractDao
{
return Purchase::class;
}
public function getFields(): array
{
return [];
}
}