提交 9cdea05c authored 作者: qhz's avatar qhz

【优化】hyperf model 增加 attributes 数组

上级 22b8a021
...@@ -55,7 +55,7 @@ Context::set(BrandAuth::class, new BrandAuth(['brand_id' => $brandId])); ...@@ -55,7 +55,7 @@ Context::set(BrandAuth::class, new BrandAuth(['brand_id' => $brandId]));
## Model 层 设置分表 ## Model 层 设置分表
app\Model\Model.php app\Model\Model.php
``` ```
public function __construct() public function __construct(array $attributes = [])
{ {
$brandAuth = get_auth_brand(); $brandAuth = get_auth_brand();
if ($brandAuth) { if ($brandAuth) {
...@@ -66,7 +66,7 @@ public function __construct() ...@@ -66,7 +66,7 @@ public function __construct()
$this->setTable($tableName); $this->setTable($tableName);
} }
} }
parent::__construct(); parent::__construct($attributes);
} }
// 获取表名 // 获取表名
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论