mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
修正关联withCount查询
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace think\model\relation;
|
||||
|
||||
use think\Db;
|
||||
use think\db\Query;
|
||||
use think\Exception;
|
||||
use think\Loader;
|
||||
@@ -201,7 +202,7 @@ class MorphMany extends Relation
|
||||
return $this->query->where([
|
||||
$this->morphKey => [
|
||||
'exp',
|
||||
'=' . $this->parent->getTable() . '.' . $this->parent->getPk(),
|
||||
Db::raw('=' . $this->parent->getTable() . '.' . $this->parent->getPk()),
|
||||
],
|
||||
$this->morphType => $this->type,
|
||||
])->fetchSql()->count();
|
||||
|
||||
Reference in New Issue
Block a user