getContext()->getRequest(); // 接收信息 $id = intval($request->getParameter('id')); // 活动id $sql = "select status from lkt_coupon_activity where id = '$id'"; $r = $db->select($sql); if($r[0]->status == 1){ $sql = "update lkt_coupon_activity set status = 2 where id = '$id'"; $res = $db->update($sql); echo $res;exit; header("Content-type:text/html;charset=utf-8"); echo ""; return; }else{ $sql = "update lkt_coupon_activity set status = 1 where id = '$id'"; $res = $db->update($sql); echo $res;exit; header("Content-type:text/html;charset=utf-8"); echo ""; return; } } public function execute(){ return $this->getDefaultView(); } public function getRequestMethods(){ return Request :: NONE; } } ?>