php的打印sql语句的方法

echo M()->_sql();

这样就可以调试当前生成的sql语句;

//获取指定天的开始时间和结束时间
$datez="2016-05-12";
$t = strtotime($datez);
$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t));
$end= mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));

$condition['add_time'][] = array('EGT',$start);
$condition['add_time'][] = array('LT',$end);

上面是查询某一天的注册量

原文地址:https://www.cnblogs.com/sengling/p/5491103.html