mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
Merge branch 'master' of https://github.com/top-think/framework
This commit is contained in:
@@ -14,6 +14,7 @@ namespace think\model;
|
|||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
use think\Loader;
|
use think\Loader;
|
||||||
|
use think\Model;
|
||||||
use think\model\Pivot;
|
use think\model\Pivot;
|
||||||
|
|
||||||
class Relation
|
class Relation
|
||||||
@@ -453,6 +454,9 @@ class Relation
|
|||||||
*/
|
*/
|
||||||
public function save($data, array $pivot = [])
|
public function save($data, array $pivot = [])
|
||||||
{
|
{
|
||||||
|
if ($data instanceof Model) {
|
||||||
|
$data = $data->toArray();
|
||||||
|
}
|
||||||
// 判断关联类型
|
// 判断关联类型
|
||||||
switch ($this->type) {
|
switch ($this->type) {
|
||||||
case self::HAS_ONE:
|
case self::HAS_ONE:
|
||||||
|
|||||||
Reference in New Issue
Block a user