|
@@ -643,7 +643,7 @@ class StatisticsService extends Service
|
|
|
$return = [];
|
|
|
foreach ($fee as $value) {
|
|
|
$value = $this->calculateFreightFeeRow($value, $time_amount);
|
|
|
- $key = $value['order_time'] . $value['area_hs'];
|
|
|
+ $key = $value['order_time'] . '|' . $value['area_hs'];
|
|
|
$return[$value['business_type_id']][$key][] = $value;
|
|
|
}
|
|
|
|
|
@@ -652,8 +652,11 @@ class StatisticsService extends Service
|
|
|
$sumFields = ['xs', 'weight', 'freight_amount', 'js_amount', 'customer_store_zx_fee', 'jj_fee', 'dh_fee', 'total_amount'];
|
|
|
|
|
|
// 业务类型 日期 地区 算一张表算运费
|
|
|
- foreach ($return as $group) {
|
|
|
- foreach ($group as $val) {
|
|
|
+ foreach ($return as $g => $group) {
|
|
|
+ $g_title = FreightFee::$business[$g] ?? "";
|
|
|
+ foreach ($group as $key => $val) {
|
|
|
+ $tmp_key = explode('|', $key);
|
|
|
+ $title = $tmp_key[1] . "(" . $g_title . ")";
|
|
|
// 计算合计
|
|
|
$sumRow = [];
|
|
|
foreach ($val as $key => $row) {
|
|
@@ -677,7 +680,11 @@ class StatisticsService extends Service
|
|
|
}
|
|
|
|
|
|
$val[] = $footer;
|
|
|
- $result[] = $val;
|
|
|
+
|
|
|
+ $result[] = [
|
|
|
+ 'key' => $title,
|
|
|
+ 'list' => $val
|
|
|
+ ];
|
|
|
}
|
|
|
}
|
|
|
|