mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
Update BelongsToMany.php
给$data默认值NULL,用于删除以关联外键为条件的中间表
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user