tp5 关联删除

        $cateInfo = model('Songcate')->with('song,song.comment')->find($id);
        foreach ($cateInfo['song'] as $v) {
            $v->together('comment')->delete();
        }
        $res = $cateInfo->together('song')->delete();
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯
原文地址:https://www.cnblogs.com/zhangcheng001/p/13371487.html