cqp 2 месяцев назад
Родитель
Сommit
cc31e194ae
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      app/Service/BIService.php

+ 4 - 2
app/Service/BIService.php

@@ -124,13 +124,15 @@ class BIService extends Service
         $monthly_ps_order_ids = array_keys($monthly_ps_order);
 
         $month_employee_salary = MonthlyPsOrderDetails::whereIn('main_id', $monthly_ps_order_ids)
-            ->select("salary", "main_id")
+            ->select("base_salary","performance_salary","other","bonus", "main_id")
             ->get()
             ->toArray();
         $total = 0;
         $salary_map = [];
         foreach ($month_employee_salary as $value) {
-            $currentAmount = (string)$value['salary'];
+            $currentAmount = bcadd($value['base_salary'], $value['performance_salary'],3);
+            $currentAmount = bcadd($currentAmount, $value['other'],3);
+            $currentAmount = bcadd($currentAmount, $value['bonus'],3);
 
             if(isset($monthly_ps_order[$value['main_id']])){
                 $month = $monthly_ps_order[$value['main_id']];