getContext()->getRequest(); $id = intval($request->getParameter('id')); // 轮播图id $yimage = addslashes(trim($request->getParameter('yimage'))); // 原图片路径带名称 $uploadImg = substr($yimage,0,strripos($yimage, '/')) . '/'; // 图片路径 $sql = "select * from lkt_banner where id = '$id'"; $r = $db->select($sql); $image = $r[0]->image; @unlink ($uploadImg.$image); // 根据轮播图id,删除轮播图信息 $sql = "delete from lkt_banner where id = '$id'"; $res=$db->delete($sql); echo $res; exit; } public function execute(){ return $this->getDefaultView(); } public function getRequestMethods(){ return Request :: NONE; } } ?>