编辑器更新,此版本还有bug,暂不要更新使用
内核更新
This commit is contained in:
@@ -680,15 +680,13 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$where = $this->updateWhere;
|
||||
}
|
||||
|
||||
if (!empty($where)) {
|
||||
$pk = $this->getPk();
|
||||
if (is_string($pk) && isset($data[$pk])) {
|
||||
if (!isset($where[$pk])) {
|
||||
unset($where);
|
||||
$where[$pk] = $data[$pk];
|
||||
}
|
||||
unset($data[$pk]);
|
||||
$pk = $this->getPk();
|
||||
if (is_string($pk) && isset($data[$pk])) {
|
||||
if (!isset($where[$pk])) {
|
||||
unset($where);
|
||||
$where[$pk] = $data[$pk];
|
||||
}
|
||||
unset($data[$pk]);
|
||||
}
|
||||
|
||||
$result = $this->db()->where($where)->update($data);
|
||||
@@ -1146,8 +1144,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
|
||||
->group('b.' . $info['foreignKey'])
|
||||
->having('count(' . $id . ')' . $operator . $count);
|
||||
case Relation::HAS_MANY_THROUGH:
|
||||
// TODO
|
||||
case Relation::HAS_MANY_THROUGH: // TODO
|
||||
default:
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1178,8 +1177,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
->field('a.*')
|
||||
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
|
||||
->where($where);
|
||||
case Relation::HAS_MANY_THROUGH:
|
||||
// TODO
|
||||
case Relation::HAS_MANY_THROUGH: // TODO
|
||||
default:
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user