mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进
This commit is contained in:
@@ -365,10 +365,12 @@ class BelongsToMany extends Relation
|
|||||||
*/
|
*/
|
||||||
public function getRelationCountQuery($closure, &$name = null)
|
public function getRelationCountQuery($closure, &$name = null)
|
||||||
{
|
{
|
||||||
|
if ($closure) {
|
||||||
$return = call_user_func_array($closure, [ & $this->query]);
|
$return = call_user_func_array($closure, [ & $this->query]);
|
||||||
if ($return && is_string($return)) {
|
if ($return && is_string($return)) {
|
||||||
$name = $return;
|
$name = $return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [
|
return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [
|
||||||
'pivot.' . $this->localKey => [
|
'pivot.' . $this->localKey => [
|
||||||
|
|||||||
Reference in New Issue
Block a user