public function albumdelAction() { $nt = new Psys_ResModel(); if (is_numeric($_GET['id'])) { $id = reqnum('id', '0'); $where = array('id' => $id); $info = $nt->GetOne($where, '*', 'rhi_album'); //取专辑信息 // ------------物理文件删除 //构建删除物理地址条件 $smallpic = $info['smallpic']; $bigpic = $info['bigpic']; //该专辑物理文件存放地址 $smallDir = ALBUM_PATH . '/' . 'small_pic' . '/' . $smallpic; $bigDir = ALBUM_PATH . '/' . 'big_pic' . '/' . $bigpic; if (file_exists($smallDir) && $smallpic != $data['smallpic']) { unlink($smallDir); } if (file_exists($bigDir) && $bigpic != $data['bigpic']) { unlink($bigDir); } //取专辑下所有歌曲并日志 $w = array('albumid' => $info['id']); $allmusic = $nt->Getlist($w, 'id DESC', 0, 0, "*", 'rhi_albummusic'); foreach ($allmusic['allrow'] as $vs) { //删除当前专辑下的音乐 //start 写操作日志 $log = array('logtype' => 71, 'guid' => $_SESSION['Cur_X_User']['id'], 'ctime' => time(), 'cip' => real_ip()); $log['logdetail'] = $_SESSION['Cur_X_User']['username'] . "于" . date("Y-m-d H:i:s") . "[删除]音乐" . $vs['mname']; $nt->admin_syslog($log); //end 日志 } //$res = $nt -> DeleteOne($where,'rhi_album'); $res = $nt->deleteOneAlbum($where); //start 写操作日志 $log = array('logtype' => 1, 'guid' => $_SESSION['Cur_X_User']['id'], 'ctime' => time(), 'cip' => real_ip()); $log['logdetail'] = $_SESSION['Cur_X_User']['username'] . "于" . date("Y-m-d H:i:s") . "[删除]音乐专辑" . $info['aname']; $nt->admin_syslog($log); //end 日志 header("Location:/res/albumlist"); } else { echo "<script>alert('id 为空');</script>"; } }