假设我在数据库内插入的订单创建时间字段是用的10位数的unix时间戳,我想查询今天的所有订单,例如:
select count() where后面不会了
不知道如何操作了!
后面的条件该怎么写?
解决方案:
$todayzero = strtotime(date('Y-m-d',time()));
//return $todayzero;
//今日访问量
$today = pdo_fetchcolumn('select count(*) from '.tablename('wc_nongplus_count'). "where uniacid=:uniacid and (createtime>=$todayzero and createtime<=:createtime)",array(':uniacid'=>$uniacid,':createtime'=>time()));
//总访问量
$counts = pdo_fetchcolumn('select count(*) from '.tablename('wc_nongplus_count'). "where uniacid=:uniacid",array(':uniacid'=>$uniacid));