// 过滤post数组中的非数据表字段数据 $user->allowField(true)->save();
$user = User::get(1); // 如果还没有关联数据 则进行新增 $user->profile()->save(['email' => 'thinkphp']);