Merge pull request #426 from kukj/patch-2

Update BelongsToMany.php
This commit is contained in:
ThinkPHP
2017-01-06 01:58:05 -06:00
committed by GitHub

View File

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