|
|
@@ -60,21 +60,21 @@ class StatisticsService extends Service
|
|
|
0 => $start_time,
|
|
|
1 => $end_time,
|
|
|
]);
|
|
|
- return [true, [$model, $time]];
|
|
|
+ return [true, [$model, $time, $day]];
|
|
|
}
|
|
|
|
|
|
public function statisticsEmployee($data,$user){
|
|
|
list($status, $return) = $this->statisticsEmployeeCommon($data, $user);
|
|
|
if(! $status) return [false, $return];
|
|
|
- list($model, $ergs) = $return;
|
|
|
+ list($model, $ergs, $day) = $return;
|
|
|
$list = $model->get()->toArray();
|
|
|
- $list = $this->statisticsEmployeeFillData($list, $ergs);
|
|
|
+ $list = $this->statisticsEmployeeFillData($list, $ergs, $day);
|
|
|
|
|
|
// $list['count'] = $this->countTotal($list, $user['header_default']);
|
|
|
return [true, $list];
|
|
|
}
|
|
|
|
|
|
- public function statisticsEmployeeFillData($data, $ergs){
|
|
|
+ public function statisticsEmployeeFillData($data, $ergs, $day){
|
|
|
$employee_id = EmployeeRole::where('del_time',0)
|
|
|
->where('role_id', 87)
|
|
|
->pluck('employee_id')
|
|
|
@@ -123,7 +123,8 @@ class StatisticsService extends Service
|
|
|
foreach ($employee as $key => $value){
|
|
|
//设置的人员在时间段内的总工时
|
|
|
$set_total_hours = $employee_hours_map[$value['id']] ?? 0;
|
|
|
- $employee[$key]['set_total_hours'] = $set_total_hours;
|
|
|
+ $hours = bcmul(bcdiv($set_total_hours,$day),8);
|
|
|
+ $employee[$key]['set_total_hours'] = $hours;
|
|
|
//汇总研发工时单里的总工时
|
|
|
$rd_total_hours = $employee_map[$value['id']] ?? 0;
|
|
|
$rd_total_hours = bcdiv($rd_total_hours,60,2);
|