Sql sql = Sqls.queryRecord("select bl.*,gm.gamename,ch.channelname FROM biz_gc_link bl LEFT JOIN biz_game gm on bl.gameid=gm.id left join biz_channel ch on bl.channelid=ch.id where 1=1 $cnd");
if(filter!=null){
String gameid=(String) filter.get("gameid");
String channelid=(String) filter.get("channelid");
String startm=(String)filter.get("startm");
String endtm=(String)filter.get("endtm");
Cnd cndsel=Cnd.NEW();
cnd.andEX("gameid","=",gameid);
cnd.andEX("channelid","=",channelid);
cnd.andEX("FROM_UNIXTIME(bl.opAt, '%Y-%m-%d')",">=",startm);
cnd.andEX("FROM_UNIXTIME(bl.opAt, '%Y-%m-%d')","<=",endtm);
sql.setVar("$cnd",cnd);
}
this.dao().execute(sql);
貌似,cnd 没生效。条件没能附加上。