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>"; } }
/** * 日期交易 */ public function dateListAction() { //var_dump($_POST);exit; global $G_X; $page = reqnum('page', 1); $pagesize = reqnum('pagesize', 10); $order = reqnum('order', 0); $ifsucc = reqnum('ifsucc', -1); //获取用户输入 $year = reqnum('year', 0); $month = reqnum('month', 0); $day = reqnum('day', 0); if (!$year || !$month || !$day) { $date = ''; } else { $date = $year . '-' . $month . '-' . $day; } if ($date == '') { $date = date('Y-m-d'); } $date = strtotime($date); //url拼接 $url = ''; $url .= '&date=' . $date; $url .= '&order=' . $order; $url .= '&ifsucc=' . $ifsucc; $model = new Psys_FinModel(); $list = $model->dateList($date, $order, $ifsucc, $page, $pagesize); //资源列表 $resModel = new Psys_ResModel(); foreach ($list['allrow'] as &$value) { $value['ctime'] = date('Y-m-d H:i:s', $value['ctime']); //下单时间格式转换 $value['cip'] = long2ip($value['cip']); //下单地址格式转换 if ($value['utime'] != '' || $value['uip'] != '') { $value['utime'] = date('Y-m-d H:i:s', $value['utime']); $value['uip'] = long2ip($value['uip']); } switch ($value['producttype']) { case 1: //视频 $value['producttype'] = $G_X['order_type']['video_type'][1]; $where = array('id' => $value['productid']); $result = $resModel->GetOneVideo($where); $value['productid'] = $result['vname']; break; case 2: //音乐 $value['producttype'] = $G_X['order_type']['music_type'][1]; $where = array('id' => $value['productid']); $result = $resModel->GetOne($where, 'mname', 'rhi_music'); $value['productid'] = $result['mname']; break; case 3: //游戏 $value['producttype'] = $G_X['order_type']['game_type'][1]; $where = array('id' => $value['productid']); $result = $resModel->GetOneGame($where); $value['productid'] = $result['appname']; break; case 4: //应用 $value['producttype'] = $G_X['order_type']['app_type'][1]; $where = array('id' => $value['productid']); $result = $resModel->GetOne($where, 'appname', 'rhi_apps'); $value['productid'] = $result['appname']; break; case 10: //美食 $value['producttype'] = $G_X['order_type']['food_type'][1]; $where = array('id' => $value['productid']); $result = $resModel->GetOne($where, 'fname', 'rhi_foodish'); $value['productid'] = $result['fname']; break; } } self::inidate($list['allnum'], $page, $pagesize, count($list['allrow'])); $this->smarty->assign('year', $year); $this->smarty->assign('month', $month); $this->smarty->assign('day', $day); $this->smarty->assign('order', $order); $this->smarty->assign('ifsucc', $ifsucc); $this->smarty->assign('url', $url); $this->smarty->assign('allnum', $list['allnum']); $this->smarty->assign('list', $list['allrow']); $this->forward = 'dateList'; }