|
@@ -158,6 +158,8 @@ class PersonSalaryService extends Service
|
|
|
$customer = $customer->toArray();
|
|
$customer = $customer->toArray();
|
|
|
$customer['crt_name'] = Employee::where('id',$customer['crt_id'])->value('title');
|
|
$customer['crt_name'] = Employee::where('id',$customer['crt_id'])->value('title');
|
|
|
$customer['crt_time'] = $customer['crt_time'] ? date("Y-m-d H:i:s",$customer['crt_time']): '';
|
|
$customer['crt_time'] = $customer['crt_time'] ? date("Y-m-d H:i:s",$customer['crt_time']): '';
|
|
|
|
|
+ $map = ArchiveService::fillIsArchive($customer['month'], $user);
|
|
|
|
|
+ $customer['is_archive'] = $map[$customer['month']] ?? false;
|
|
|
$customer['month'] = $customer['month'] ? date("Y-m",$customer['month']): '';
|
|
$customer['month'] = $customer['month'] ? date("Y-m",$customer['month']): '';
|
|
|
|
|
|
|
|
$details = $this->getDetail($data['id']);
|
|
$details = $this->getDetail($data['id']);
|
|
@@ -193,7 +195,7 @@ class PersonSalaryService extends Service
|
|
|
public function MonthlyPsOrderList($data,$user){
|
|
public function MonthlyPsOrderList($data,$user){
|
|
|
$model = $this->MonthlyPsOrderCommon($data, $user);
|
|
$model = $this->MonthlyPsOrderCommon($data, $user);
|
|
|
$list = $this->limit($model,'',$data);
|
|
$list = $this->limit($model,'',$data);
|
|
|
- $list = $this->fillData($list);
|
|
|
|
|
|
|
+ $list = $this->fillData($list, $user);
|
|
|
|
|
|
|
|
return [true, $list];
|
|
return [true, $list];
|
|
|
}
|
|
}
|
|
@@ -246,14 +248,18 @@ class PersonSalaryService extends Service
|
|
|
return [true, ''];
|
|
return [true, ''];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function fillData($data){
|
|
|
|
|
|
|
+ public function fillData($data, $user){
|
|
|
if(empty($data['data'])) return $data;
|
|
if(empty($data['data'])) return $data;
|
|
|
|
|
|
|
|
$emp = (new EmployeeService())->getEmployeeMap(array_unique(array_column($data['data'],'crt_id')));
|
|
$emp = (new EmployeeService())->getEmployeeMap(array_unique(array_column($data['data'],'crt_id')));
|
|
|
|
|
+ $map = ArchiveService::fillIsArchive(array_unique(array_column($data['data'],'month')), $user);
|
|
|
|
|
+
|
|
|
foreach ($data['data'] as $key => $value){
|
|
foreach ($data['data'] as $key => $value){
|
|
|
$data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s',$value['crt_time']) : '';
|
|
$data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s',$value['crt_time']) : '';
|
|
|
|
|
+ $data['data'][$key]['is_archive'] = $map[$value['month']] ?? false;
|
|
|
$data['data'][$key]['month'] = $value['month'] ? date('Y-m',$value['month']) : '';
|
|
$data['data'][$key]['month'] = $value['month'] ? date('Y-m',$value['month']) : '';
|
|
|
$data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
|
|
$data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
|
return $data;
|