$cateInfo = model('Songcate')->with('song,song.comment')->find($id); foreach ($cateInfo['song'] as $v) { $v->together('comment')->delete(); } $res = $cateInfo->together('song')->delete();
tp5 关联删除
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯
$cateInfo = model('Songcate')->with('song,song.comment')->find($id); foreach ($cateInfo['song'] as $v) { $v->together('comment')->delete(); } $res = $cateInfo->together('song')->delete();