$arr="select sum(weight) as weight,s_id, CONCAT(YEAR(date),'-',MONTH(date)) AS releaseYearMonth from (select bf_clean.* FROM bf_clean,bf_dclear where bf_clean.s_id = bf_dclear.id) as bf_clean GROUP BY s_id,releaseYearMonth desc";
(两张表联查。查看当月数据总和)
$a=Db::query($arr);