Update BelongsToMany.php

给$data默认值NULL,用于删除以关联外键为条件的中间表
This commit is contained in:
悠悠山雨
2017-01-06 15:10:59 +08:00
committed by GitHub
parent 418c029f89
commit 4afee9c8b8

View File

@@ -308,7 +308,7 @@ class BelongsToMany extends Relation
* @param bool $relationDel 是否同时删除关联表数据
* @return integer
*/
public function detach($data, $relationDel = false)
public function detach($data = null, $relationDel = false)
{
if (is_array($data)) {
$id = $data;