MySQL实战基础知识入门(3):近7日销量合计php后端mysql语句如果当日为空则自动补0的解决方案
publicfunctiongetEveryDay(){global$db,$res;dbc();$NowTimes=date("Y-m-d",time());$sql="selectDATE_FORMAT(paid_at,'%Y-%m-%d')asdataKey,ifnull(COUNT(id),0)AStotalTrans,ifnull(SUM(should_paid),0)AStotalPa