diff --git a/app/controller/api/dataview/Order.php b/app/controller/api/dataview/Order.php index c5b811be..bfb769b9 100755 --- a/app/controller/api/dataview/Order.php +++ b/app/controller/api/dataview/Order.php @@ -411,7 +411,8 @@ class Order extends BaseController $merchantRankingTotal += $v['total_sales']; } - // 统计每个镇的商品数 + // 统计每个镇的商品数. + $townProductCount = 0; $townProductCountList = []; $geoStreetList = Db::name('geo_street')->field('street_name, street_code')->where('area_code',$this->areaCode)->select()->toArray(); foreach ($geoStreetList as $k => $street) { @@ -420,7 +421,8 @@ class Order extends BaseController ->where('m.street_id', $street['street_code']) ->count(); $townProductCountList[] = $street; + $townProductCount += $street['product_count']; } - return \app('json')->success(compact('productRankingTotal','productRankingList', 'merchantRankingTotal','merchantRankingList', 'townProductCountList')); + return \app('json')->success(compact('productRankingTotal','productRankingList', 'merchantRankingTotal','merchantRankingList', 'townProductCount','townProductCountList')); } } \ No newline at end of file