mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正Relation类 改进Route类的group方法
This commit is contained in:
@@ -85,9 +85,9 @@ class Relation
|
||||
break;
|
||||
case self::BELONGS_TO_MANY:
|
||||
// 关联查询
|
||||
$pk = $this->parent->getPk();
|
||||
$condition['pivot.' . $foreignKey] = $this->parent->$pk;
|
||||
$result = $this->belongsToManyQuery($relation, $this->middle, $foreignKey, $localKey, $condition)->select();
|
||||
$pk = $this->parent->getPk();
|
||||
$condition['pivot.' . $localKey] = $this->parent->$pk;
|
||||
$result = $this->belongsToManyQuery($relation, $this->middle, $foreignKey, $localKey, $condition)->select();
|
||||
foreach ($result as $set) {
|
||||
$pivot = [];
|
||||
foreach ($set->toArray() as $key => $val) {
|
||||
|
||||
Reference in New Issue
Block a user