|
|
@@ -309,7 +309,7 @@ class BasicPanel extends Controller
|
|
|
->select(['province_name', DB::raw('count(province_name) as count')])
|
|
|
->groupby('province_name')
|
|
|
->orderby('count', 'desc')
|
|
|
- ->get()->toarray();
|
|
|
+ ->get()->toArray();
|
|
|
$province_totle_count = 0;
|
|
|
if(!empty($result)){
|
|
|
$province_totle_count = array_sum(array_column($result, 'count'));
|
|
|
@@ -386,10 +386,10 @@ class BasicPanel extends Controller
|
|
|
->select(['city_name', DB::raw('count(city_name) as count')])
|
|
|
->groupby('city_name')
|
|
|
->orderby('count', 'desc')
|
|
|
- ->get()->toarray();
|
|
|
+ ->get()->toArray();
|
|
|
$city_totle_count = 0;
|
|
|
if(!empty($result)){
|
|
|
- $city_totle_count = array_sum(array_column($result->toarray(), 'count'));
|
|
|
+ $city_totle_count = array_sum(array_column($result->toArray(), 'count'));
|
|
|
//计算占比
|
|
|
foreach ($result as $key => $value) {
|
|
|
$result[$key]['percent'] = round(($value['count'] / $city_totle_count) * 100, 2);
|
|
|
@@ -652,10 +652,10 @@ class BasicPanel extends Controller
|
|
|
->select(['province_name', DB::raw('count(province_name) as count')])
|
|
|
->groupby('province_name')
|
|
|
->orderby('count', 'desc')
|
|
|
- ->get()->toarray();
|
|
|
+ ->get()->toArray();
|
|
|
$province_totle_count = 0;
|
|
|
if (!empty($result)) {
|
|
|
- $province_totle_count = array_sum(array_column($result->toarray(), 'count'));
|
|
|
+ $province_totle_count = array_sum(array_column($result->toArray(), 'count'));
|
|
|
foreach ($result as $key => $value) {
|
|
|
$result[$key]['percent'] = round(($value['count'] / $province_totle_count) * 100, 2);
|
|
|
}
|
|
|
@@ -729,10 +729,10 @@ class BasicPanel extends Controller
|
|
|
->select(['city_name', DB::raw('count(city_name) as count')])
|
|
|
->groupby('city_name')
|
|
|
->orderby('count', 'desc')
|
|
|
- ->get()->toarray();
|
|
|
+ ->get()->toArray();
|
|
|
$city_totle_count = 0;
|
|
|
if (!empty($result)) {
|
|
|
- $city_totle_count = array_sum(array_column($result->toarray(), 'count'));
|
|
|
+ $city_totle_count = array_sum(array_column($result->toArray(), 'count'));
|
|
|
foreach ($result as $key => $value) {
|
|
|
$result[$key]['percent'] = round(($value['count'] / $city_totle_count) * 100, 2);
|
|
|
}
|