天天看點

tag

<%@tag body-content="empty" pageEncoding="utf-8" %>

<%@ attribute name="var" required="true" rtexprvalue="false" %>

<%@ variable name-from-attribute="var" alias="obj"  scope="AT_BEGIN" %>

<%

String tradeId = "75";

DBHelper db = DBHelper.getInstance();

Map obj=new HashMap();

Map website = SessionTools.currentWebsite(request);

Map memberInfo = SessionTools.currentCommonMember(request);

String memberId = null;

    if(memberInfo!=null)memberId = Common.getString(memberInfo.get("id")); 

else memberId = "0";

String status=Common.getString(request, "status");

    String show=Common.getString(request, "show");

String size_tijiao=Common.getString((db.map("select count(*) size  from wcm_common_member_buy where sid=? and member_id=? and status=0 and is_show=1",new Object[]{tradeId,memberId})).get("size"));

String size_chengjiao=Common.getString((db.map("select count(*) size  from wcm_common_member_buy where sid=? and member_id=? and status=1 and is_show=1",new Object[]{tradeId,memberId})).get("size"));

String size_quxiao=Common.getString((db.map("select count(*) size  from wcm_common_member_buy where sid=? and member_id=? and is_show=0",new Object[]{tradeId,memberId})).get("size"));

obj.put("size_tijiao",size_tijiao);

obj.put("size_chengjiao",size_chengjiao);

obj.put("size_quxiao",size_quxiao);

List<Map> list = db.list("select id ,title,pub_date,end_date,status from wcm_common_member_buy where sid=? and member_id=?",new Object[]{tradeId,memberId});

if(!("".equals(status))&&status!=null){

list=db.list("select  id , title,pub_date,end_date,status,is_show from wcm_common_member_buy where sid=? and member_id=? and status=? and is_show=1",new Object[]{tradeId,memberId,status});

}

if(!("".equals(show))&&show!=null){

list=db.list("select id, title,pub_date,end_date,status ,is_show from wcm_common_member_buy where sid=? and member_id=? and is_show=?",new Object[]{tradeId,memberId,show});

    for(Map o:list){

      String pub_date= Common.getString(o.get("pub_date")).substring(0,10);

      String end_date=Common.getString(o.get("end_date")).substring(0,10);

 o.put("pub_date",pub_date);

 o.put("end_date",end_date);

   }

obj.put("list",list);

tag

繼續閱讀