Skip to content

Commit eca7ebe

Browse files
committed
改进模型的suffix方法调用处理
1 parent b04d227 commit eca7ebe

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/model/View.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,11 @@ public static function __callStatic($method, $args)
727727
{
728728
$entity = new static();
729729
$model = $entity->model();
730+
731+
if ('suffix' == $method) {
732+
$model->setSuffix($args[0]);
733+
}
734+
730735
if (in_array($method, ['destroy'])) {
731736
$db = $model;
732737
} else {

src/model/concern/DbConnect.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ public static function withoutGlobalScope(?array $scope = null): Query
181181
public static function __callStatic($method, $args)
182182
{
183183
$model = new static();
184+
185+
if ('suffix' == $method) {
186+
$model->setSuffix($args[0]);
187+
}
188+
184189
$db = $model->db();
185190

186191
if (!empty(self::$weakMap[$model]['autoRelation'])) {

0 commit comments

Comments
 (0)