Exemple #1
0
 public function delAction()
 {
     $p = $_REQUEST;
     $pId = empty($p['id']) ? die('id不能为空') : intval($p['id']);
     $tBMO = new BannerModel();
     $tRow = $tBMO->field('img')->where(' id = ' . $pId)->fROw();
     $tSql = 'delete from ' . $tBMO->table . ' where id = ' . $pId;
     if (!$tBMO->exec($tSql)) {
         Tool_Fnc::ajaxMsg('删除失败');
     }
     if (!empty($tRow['img'])) {
         unlink(APPLICATION_PATH . '/public' . $tRow['img']);
     }
     Tool_Fnc::ajaxMsg('删除成功', 1);
 }