Ver código fonte

改一下bug

gogs 2 meses atrás
pai
commit
bb8d381b50
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      app/Service/StatisticService.php

+ 3 - 1
app/Service/StatisticService.php

@@ -972,7 +972,9 @@ class StatisticService extends Service
         foreach ($fee_amount as $v) {
             //人工费用
             if ($v['type'] == 1 || $v['type'] == 2) {
+//                var_dump();
                 foreach ($item_key_list as $vv) {
+                    if(!isset($item_salary[$vv['id'] . "_" . date("Y-m", $v['voucher_date'])]['allocated_salary'])) continue;
                     $detail = [
                         "code" => $vv['code'],
                         "title" => $vv['title'],
@@ -983,7 +985,7 @@ class StatisticService extends Service
                         "voucher_remark" => $v['voucher_remark'],
                         "voucher_amount" => $v['voucher_amount'],
                         "aggregation_amount" => $v['aggregation_amount'],
-                        "total_amount" => $v['type'] == 1 ?round( $item_salary[$vv['item_id'] . "_" . date("Y-m", $v['voucher_date'])]['allocated_salary']/100,2) : (isset($device_depreciation[$vv['item_id'] . "_" . date("Y-m", $v['voucher_date'])]['depreciation']) ?round($device_depreciation[$vv['item_id'] . "_" . date("Y-m", $v['voucher_date'])]['depreciation']/100,2) : 0),
+                        "total_amount" => $v['type'] == 1 ?round( $item_salary[$vv['id'] . "_" . date("Y-m", $v['voucher_date'])]['allocated_salary']/100,2) : (isset($device_depreciation[$vv['id'] . "_" . date("Y-m", $v['voucher_date'])]['depreciation']) ?round($device_depreciation[$vv['id'] . "_" . date("Y-m", $v['voucher_date'])]['depreciation']/100,2) : 0),
                         "fee_id" => $v['fee_id'],
                         "entrust1_amount" => $v['entrust1_amount'],
                         "entrust2_amount" => $v['entrust2_amount'],