升级到31版本、修改学生成绩筛选
This commit is contained in:
1 parent
a79e7bf237
commit
d8ec4fad39
34 files changed
+447
-114
No files matched your search
@@ -240,6 +240,18 @@ class HasMany extends Relation
|
||||
* @return Model|false
|
||||
*/
|
||||
public function save($data, $replace = true)
|
||||
{
|
||||
$model = $this->make($data);
|
||||
|
||||
return $model->replace($replace)->save() ? $model : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建关联对象实例
|
||||
* @param array $data
|
||||
* @return Model
|
||||
*/
|
||||
public function make($data = [])
|
||||
{
|
||||
if ($data instanceof Model) {
|
||||
$data = $data->getData();
|
||||
@@ -248,9 +260,7 @@ class HasMany extends Relation
|
||||
// 保存关联表数据
|
||||
$data[$this->foreignKey] = $this->parent->{$this->localKey};
|
||||
|
||||
$model = new $this->model;
|
||||
|
||||
return $model->replace($replace)->save($data) ? $model : false;
|
||||
return new $this->model($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user