add 数据之眼-平台商品/店铺排行,地方商品数量统计接口

This commit is contained in:
chenbo 2023-12-06 12:04:47 +08:00
parent bfd258d62f
commit a8fb7eca74

View File

@ -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'));
}
}