|
|
@@ -3369,12 +3369,16 @@ class ItemService extends Service
|
|
|
if(empty($data['data'])) return $data;
|
|
|
|
|
|
$emp = (new EmployeeService())->getEmployeeMap(array_unique(array_column($data['data'],'crt_id')));
|
|
|
+ $time = time();
|
|
|
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]['expire_time'] = $value['expire_time'] ? date('Y-m-d',$value['expire_time']) : '';
|
|
|
$data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
|
|
|
$data['data'][$key]['status_title'] = ItemNodeMissionShare::State_Type[$value['status']] ?? '';
|
|
|
$data['data'][$key]['type_title'] = ItemNodeMissionShare::QX_Type[$value['type']] ?? '';
|
|
|
+ $final_status = $this->fillFinalStatus($value, $time);
|
|
|
+ $data['data'][$key]['final_status'] = $final_status;
|
|
|
+ $data['data'][$key]['final_status_title'] = ItemNodeMissionShare::State_Type[$final_status] ?? '';
|
|
|
}
|
|
|
|
|
|
return $data;
|
|
|
@@ -3393,10 +3397,21 @@ class ItemService extends Service
|
|
|
$customer['crt_time'] = $customer['crt_time'] ? date("Y-m-d H:i:s",$customer['crt_time']): '';
|
|
|
$customer['status_title'] = ItemNodeMissionShare::State_Type[$customer['status']] ?? '';
|
|
|
$customer['type_title'] = ItemNodeMissionShare::QX_Type[$customer['type']] ?? '';
|
|
|
+ $final_status = $this->fillFinalStatus($customer, time());
|
|
|
+ $customer['final_status'] = $final_status;
|
|
|
+ $customer['final_status_title'] = ItemNodeMissionShare::State_Type[$final_status] ?? '';
|
|
|
|
|
|
return [true, $customer];
|
|
|
}
|
|
|
|
|
|
+ private function fillFinalStatus($value, $currentTime){
|
|
|
+ if ($value['status'] == ItemNodeMissionShare::TYPE_ONE || $value['expire_time'] <= $currentTime) {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $value['status'];
|
|
|
+ }
|
|
|
+
|
|
|
public function shareCancel($data, $user){
|
|
|
if($this->isEmpty($data,'id')) return [false,'请选择数据!'];
|
|
|
|