diff --git a/app/api/controller/Statistics.php b/app/api/controller/Statistics.php index 4556d3b..7cc0ea7 100644 --- a/app/api/controller/Statistics.php +++ b/app/api/controller/Statistics.php @@ -874,7 +874,7 @@ class Statistics extends BaseController $m = bcmul(bcdiv($m,$max,3),100,1); } $return['liuliang'] = $m; - $return['month'] = 12; + $return['month'] = date('m'); // 商品销量前十 $return['data'] = Db::connect('shop')->table('eb_store_product') ->alias('a') @@ -891,6 +891,7 @@ class Statistics extends BaseController ->group('a.product_id')->sum('c.total_num'); }) ->where($where) + ->whereMonth('b.create_time', date('Y-M')) ->limit(10) ->group('a.product_id') ->order('value desc')