|
|
@@ -202,11 +202,9 @@ class LaborReport extends Model
|
|
|
//进场时间
|
|
|
public function getEnterAtAttribute()
|
|
|
{
|
|
|
- if ($this['userDutyCheck']&&$this['userDutyCheck']['type']=='登入')
|
|
|
- return $this['userDutyCheck']?$this['userDutyCheck']['checked_at']:null;
|
|
|
-// $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','未审核')->orderBy('id','desc')->first();
|
|
|
-// if (empty($laborReportStatus))return null;
|
|
|
-// return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
|
|
|
+ $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','未审核')->orderBy('id','desc')->first();
|
|
|
+ if (empty($laborReportStatus))return null;
|
|
|
+ return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
|
|
|
}
|
|
|
|
|
|
public function getEnteringRecordAttribute()
|
|
|
@@ -221,11 +219,9 @@ class LaborReport extends Model
|
|
|
|
|
|
public function getExitAtAttribute()
|
|
|
{
|
|
|
- if ($this['userDutyCheck']&&$this['userDutyCheck']['type']=='登出')
|
|
|
- return $this['userDutyCheck']?$this['userDutyCheck']['checked_at']:null;
|
|
|
-// $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','已退场')->orderBy('id','desc')->first();
|
|
|
-// if (empty($laborReportStatus))return null;
|
|
|
-// return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
|
|
|
+ $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','已退场')->orderBy('id','desc')->first();
|
|
|
+ if (empty($laborReportStatus))return null;
|
|
|
+ return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
|
|
|
}
|
|
|
|
|
|
//创建或获取进场编号
|