$msql = "select MONTH (date(FROM_UNIXTIME(time))) as time,sum(amount) price,count(id) sum from st_pays_shangjia where status = 1 and YEAR(date(FROM_UNIXTIME(time)))={$year} group by time";
$month = M('pays_shangjia')->Field('MONTH (date(FROM_UNIXTIME(time))) as time,sum(amount) price,count(id) sum')->where($where)->group('time')->select();
统计每个月的数据$msql = "select MONTH (date(FROM_UNIXTIME(time))) as time,sum(amount) price,count(id) sum from st_pays_shangjia where status = 1 and YEAR(date(FROM_UNIXTIME(time)))={$year} group by time"; ...