LaborReport.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <?php
  2. namespace App;
  3. use Carbon\Carbon;
  4. use Illuminate\Database\Eloquent\Model;
  5. use App\Traits\ModelTimeFormat;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7. use Illuminate\Support\Arr;
  8. use Illuminate\Support\Facades\Auth;
  9. use Illuminate\Support\Facades\Gate;
  10. class LaborReport extends Model
  11. {
  12. use ModelTimeFormat;
  13. use SoftDeletes;
  14. protected $fillable=[
  15. 'id','enter_number','user_workgroup_id','user_id','name','mobile_phone','identity_number','labor_company_id',
  16. 'check_in_at','verify_at','group_user_id','check_out_at','online_duration','working_duration','created_at','updated_at',
  17. 'user_duty_check_id','relax_time'
  18. ];
  19. protected $appends = [
  20. 'is_exportGroup','is_export', 'exit_at','enter_at','sequence', 'amountOfJoined','remark','thisRecordOnlineTime','thisRecordWorkingTime','thisRoundRecordWorkingTime',
  21. 'totalOnlineTime','verifyPerson','userDutyCheckVerifyUserId','isAdult','round_check_in_at','round_check_out_at','has_group_verify_right'
  22. ];
  23. protected $tempFields = [
  24. 'temEnteringRecord',
  25. 'sequence',
  26. 'amountOfJoined',
  27. ];
  28. static function tokenOfBroadcastEnterAndLeave(){
  29. return md5('tokenOfListAll'.Carbon::now()->format('Y-m-d'));
  30. }
  31. public function userWorkgroup(){
  32. return $this->hasOne('App\UserWorkgroup','id','user_workgroup_id');
  33. }
  34. public function laborCompany(){
  35. return $this->hasOne('App\LaborCompany','id','labor_company_id');
  36. }
  37. public function user(){
  38. return $this->hasOne('App\User','id','group_user_id');
  39. }
  40. public function userDutyCheck(){
  41. return $this->hasOne('App\UserDutyCheck','id','user_duty_check_id');
  42. }
  43. public function laborReportStatus(){
  44. return $this->hasMany('App\LaborReportStatus','labor_report_id','id');
  45. }
  46. public function getRoundCheckInAtAttribute(){
  47. if (!$this['check_in_at'])return null;
  48. $round_check_in_at=Carbon::parse($this['check_in_at'])->format('i');
  49. if ($round_check_in_at>=0&&$round_check_in_at<=5) return Carbon::parse($this['check_in_at'])->clone()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
  50. if ($round_check_in_at>5&&$round_check_in_at<=35) return Carbon::parse($this['check_in_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
  51. //if ($round_check_in_at==30) return Carbon::parse($this['check_in_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
  52. if ($round_check_in_at>35&&$round_check_in_at<=59) return Carbon::parse($this['check_in_at'])->clone()->addHour()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
  53. }
  54. public function getRoundCheckOutAtAttribute(){
  55. if (!$this['check_out_at'])return null;
  56. $round_check_out_at=Carbon::parse($this['check_out_at'])->format('i');
  57. if ($round_check_out_at>=0&&$round_check_out_at<25) return Carbon::parse($this['check_out_at'])->clone()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
  58. if ($round_check_out_at>=25&&$round_check_out_at<=55) return Carbon::parse($this['check_out_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
  59. //if ($round_check_out_at==30) return Carbon::parse($this['check_out_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
  60. if ($round_check_out_at>55&&$round_check_out_at<=59) return Carbon::parse($this['check_out_at'])->clone()->addHour()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
  61. }
  62. public function getRemarkAttribute(){
  63. return $this->hasOne('App\Sign','signable_id','id')
  64. ->where('field','remark')->where('signable_type','labor_reports')->value('mark');
  65. }
  66. public function getHasGroupVerifyRightAttribute(){
  67. if (!Gate::allows('人事管理-临时工报表')){return null; }
  68. if (Gate::allows('人事管理-临时工报表-管理全部组')){return true;}
  69. $user=Auth::user();
  70. $userWorkgroupIds=$user->getPermittingWorkgroupIds($allowAll=false);
  71. if (count($userWorkgroupIds)!=0) return in_array($this['user_workgroup_id'],$userWorkgroupIds);
  72. }
  73. public function setRemarkAttribute($remark,$id){
  74. return Sign::updateOrCreate(['signable_type'=>'labor_reports','signable_id'=>$id,'field'=>'remark'],['mark'=>$remark]);
  75. }
  76. public function getIsExportGroupAttribute(){
  77. return $this['check_out_at']? true:false;
  78. }
  79. public function getVerifyPersonAttribute(){
  80. if ($this['group_user_id']&&$this['group_user_id']==Auth::user()['id'])
  81. return Auth::user()['name'];
  82. }
  83. public function getUserDutyCheckVerifyUserIdAttribute(){
  84. return $this['userDutyCheck']['verify_user_id']?$this['userDutyCheck']['verify_user_id']:'';
  85. }
  86. //总在线时长
  87. public function getTotalOnlineTimeAttribute(){
  88. $laborReports=LaborReport::where('enter_number',$this['enter_number'])->get();
  89. $totalOnlineTime=$laborReports->reduce(function ($value,$laborReport){
  90. return ($value??0)+$laborReport['thisRecordOnlineTime'];
  91. });
  92. return $totalOnlineTime;
  93. }
  94. //总工作时长
  95. public function getTotalWorkingTimeAttribute(){
  96. $laborReports=LaborReport::where('enter_number',$this['enter_number'])->orderBy('id','asc')->get();
  97. $totalWorkingTime=$laborReports->reduce(function ($value,$laborReport){
  98. return ($value??0)+$laborReport['thisRecordWorkingTime'];
  99. });
  100. return $totalWorkingTime;
  101. }
  102. //本轮工作起始时间
  103. public function getThisRoundOnlineStartTimeAttribute(){
  104. $laborReports=LaborReport::where('enter_number',$this['enter_number'])->orderBy('id','asc')->get();
  105. foreach ($laborReports as $laborReport){
  106. if ($laborReport['enter_at']&&$laborReport['check_in_at'])
  107. return $laborReport['check_in_at'];
  108. }
  109. }
  110. //本轮工作结束时间
  111. public function getThisRoundOnlineEndTimeAttribute(){
  112. $laborReports=LaborReport::where('enter_number',$this['enter_number'])->get();
  113. foreach ($laborReports as $laborReport){
  114. if ($laborReport['exit_at']&&$laborReport['check_out_at'])
  115. return $laborReport['check_out_at'];
  116. }
  117. }
  118. //本次在线时长
  119. public function getThisRecordOnlineTimeAttribute(){
  120. if($this['enter_at']&&!$this['check_out_at']&&!$this['exit_at'])
  121. return round(Carbon::parse(Carbon::now())->diffInSeconds(Carbon::parse($this['enter_at']))/3600,2);
  122. if ($this['enter_at']&&$this['check_out_at']&&!$this['exit_at'])
  123. return round(Carbon::parse($this['check_out_at'])->diffInSeconds(Carbon::parse($this['enter_at']))/3600,2);
  124. if ($this['enter_at']&&$this['exit_at'])
  125. return round(Carbon::parse($this['exit_at'])->diffInSeconds(Carbon::parse($this['enter_at']))/3600,2);
  126. if ($this['check_in_at']&&!$this['enter_at']&&!$this['check_out_at']&&!$this['exit_at'])
  127. return round(Carbon::parse(Carbon::now())->diffInSeconds(Carbon::parse($this['check_in_at']))/3600,2);
  128. if ($this['check_in_at']&&!$this['enter_at']&&$this['check_out_at']&&!$this['exit_at'])
  129. return round(Carbon::parse($this['check_out_at'])->diffInSeconds(Carbon::parse($this['check_in_at']))/3600,2);
  130. if ($this['check_in_at']&&!$this['enter_at']&&$this['exit_at'])
  131. return round(Carbon::parse($this['exit_at'])->diffInSeconds(Carbon::parse($this['check_in_at']))/3600,2);
  132. }
  133. //本次工作时长
  134. public function getThisRecordWorkingTimeAttribute(){
  135. if ($this['check_in_at']&&!$this['check_out_at']&&!$this['relax_time']){
  136. $workingTime=round(Carbon::parse(Carbon::now())->diffInSeconds(Carbon::parse($this['check_in_at']))/3600,2);
  137. $checkInTime=Carbon::parse($this['check_in_at']);
  138. $checkOutTime=Carbon::parse(Carbon::now())->format('H');
  139. return $this->minusLunchTime($checkInTime,$checkOutTime,$workingTime);
  140. }
  141. if ($this['check_in_at']&&$this['check_out_at']&&!$this['relax_time']){
  142. $workingTime=round(Carbon::parse($this['check_out_at'])->diffInSeconds(Carbon::parse($this['check_in_at']))/3600,2);
  143. $checkInTime=Carbon::parse($this['check_in_at']);
  144. $checkOutTime=Carbon::parse($this['check_out_at'])->format('H');
  145. return $this->minusLunchTime($checkInTime,$checkOutTime,$workingTime);
  146. }
  147. if ($this['check_in_at']&&$this['check_out_at']&&$this['relax_time']){
  148. $workingTime=round(Carbon::parse($this['check_out_at'])->diffInSeconds(Carbon::parse($this['check_in_at']))/3600,2);
  149. $checkInTime=Carbon::parse($this['check_in_at']);
  150. $checkOutTime=Carbon::parse($this['check_out_at'])->format('H');
  151. return $this->minusLunchTime($checkInTime,$checkOutTime,$workingTime)-$this['relax_time']/60;
  152. }
  153. }
  154. //本次取整工作时长
  155. public function getThisRoundRecordWorkingTimeAttribute(){
  156. if ($this['round_check_in_at']&&!$this['round_check_out_at']&&!$this['relax_time']){
  157. $workingTime=round(Carbon::parse(Carbon::now())->diffInSeconds(Carbon::parse($this['round_check_in_at']))/3600,2);
  158. $checkInTime=Carbon::parse($this['round_check_in_at']);
  159. $checkOutTime=Carbon::parse(Carbon::now())->format('H');
  160. return $this->minusLunchTime($checkInTime,$checkOutTime,$workingTime);
  161. }
  162. if ($this['round_check_in_at']&&$this['round_check_out_at']&&!$this['relax_time']){
  163. $workingTime=round(Carbon::parse($this['round_check_out_at'])->diffInSeconds(Carbon::parse($this['round_check_in_at']))/3600,2);
  164. $checkInTime=Carbon::parse($this['round_check_in_at']);
  165. $checkOutTime=Carbon::parse($this['round_check_out_at'])->format('H');
  166. return $this->minusLunchTime($checkInTime,$checkOutTime,$workingTime);
  167. }
  168. if ($this['round_check_in_at']&&$this['round_check_out_at']&&$this['relax_time']){
  169. $workingTime=round(Carbon::parse($this['round_check_out_at'])->diffInSeconds(Carbon::parse($this['round_check_in_at']))/3600,2);
  170. $checkInTime=Carbon::parse($this['round_check_in_at']);
  171. $checkOutTime=Carbon::parse($this['round_check_out_at'])->format('H');
  172. return $this->minusLunchTime($checkInTime,$checkOutTime,$workingTime)-$this['relax_time']/60;
  173. }
  174. }
  175. //工作时长减午饭休息时间
  176. public function minusLunchTime($checkInTime,$checkOutTime,$hour){
  177. if ($checkInTime->lessThanOrEqualTo($checkInTime->clone()->setHours(11)->setMinutes(30))&&(int)$checkOutTime>=13){
  178. $hour=$hour-1;
  179. }
  180. return $hour;
  181. }
  182. //转场序号
  183. public function getSequenceAttribute()
  184. {
  185. if(Arr::has($this->tempFields,'sequence'))return $this->tempFields['sequence'];
  186. $laborReports=LaborReport::where('enter_number',$this['enter_number'])->orderBy('id','asc')->get();
  187. foreach($laborReports as $i=>$laborReport){
  188. if($laborReport['id']==$this['id']){
  189. $this->tempFields['sequence']=$i+1;
  190. return $this->tempFields['sequence'];
  191. }
  192. }
  193. }
  194. public function getAmountOfJoinedAttribute()
  195. {
  196. if(Arr::has($this->tempFields,'amountOfJoined'))return $this->tempFields['amountOfJoined'];
  197. $this->tempFields['amountOfJoined']=LaborReport::where('enter_number',$this['enter_number'])->orderBy('id','asc')->count();
  198. return $this->tempFields['amountOfJoined'];
  199. }
  200. //进场时间
  201. public function getEnterAtAttribute()
  202. {
  203. $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','未审核')->orderBy('id','desc')->first();
  204. if (empty($laborReportStatus))return null;
  205. return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
  206. }
  207. public function getEnteringRecordAttribute()
  208. {
  209. $laborReport=LaborReport::with(['laborReportStatus'=>function($query){
  210. return $query->whereIn('status',['已入场','未审核']);
  211. }])->where('user_id',$this['user_id'])->orderBy('id','desc')->first();
  212. if(empty($laborReport))return null;
  213. return $laborReport;
  214. }
  215. public function getExitAtAttribute()
  216. {
  217. $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->where('status','已退场')->orderBy('id','desc')->first();
  218. if (empty($laborReportStatus))return null;
  219. return Carbon::parse($laborReportStatus['created_at'])->format('Y-m-d H:i:s');
  220. }
  221. //创建或获取进场编号
  222. public function makeOrGetEnteringNumber()
  223. {
  224. if($this['enteringRecord']&&$this['enteringRecord']['enter_number'])
  225. return $this['enteringRecord']['enter_number'];
  226. $enteringNumber=date("ymd").str_pad($this['id']>99999?$this['id']%99999:$this['id'],4,"0",STR_PAD_LEFT);
  227. $this['enter_number']=$enteringNumber;
  228. return $enteringNumber;
  229. }
  230. public function getIsExportAttribute(){
  231. $laborReportStatus=LaborReportStatus::where('labor_report_id',$this['id'])->orderBy('id','desc')->first();
  232. return $laborReportStatus['status']=='已退场'?true:false;
  233. }
  234. //出场更新临时工报表信息
  235. static function exitAndChangeLaborReport($laborReport,$userDutyCheck){
  236. $laborReportStatus=new LaborReportStatus([
  237. 'labor_report_id'=>$laborReport['id'],
  238. 'status'=>'已退场',
  239. ]);
  240. $laborReportStatus->save();
  241. $check_in_at=$laborReport->check_in_at??null;
  242. $exit_at=$userDutyCheck->checked_at;
  243. $online_duration=round(Carbon::parse($exit_at)->diffInSeconds(Carbon::parse($check_in_at))/3600,2);
  244. $laborReport->user_duty_check_id=$userDutyCheck->id;
  245. if ($laborReport->enter_at){
  246. $enter_at=$laborReport['enter_at'];
  247. $laborReport->online_duration=round(Carbon::parse($exit_at)->diffInSeconds(Carbon::parse($enter_at))/3600,2);
  248. }else{
  249. $laborReport->online_duration=$online_duration;
  250. }
  251. $laborReport->update();
  252. $laborReport->is_export=$laborReport->getIsExportAttribute();
  253. return $laborReport;
  254. }
  255. /**
  256. * 是否成年
  257. * @param 身份证号
  258. * @return int 0 成年,1未成年
  259. */
  260. public function getIsAdultAttribute(){
  261. $flag = 0;
  262. $tyear=intval(substr($this['identity_number'],6,4));
  263. $tmonth=intval(substr($this['identity_number'],10,2));
  264. $tday=intval(substr($this['identity_number'],12,2));
  265. if($tyear>date("Y")||$tyear<(date("Y")-100)){
  266. $flag=0;
  267. }elseif($tmonth<0||$tmonth>12){
  268. $flag=0;
  269. }elseif($tday<0||$tday>31){
  270. $flag=0;
  271. }else{
  272. $day_sum = self::full_year_day($tyear,$tmonth,16);
  273. if((time()-mktime(0,0,0,$tmonth,$tday,$tyear))>$day_sum*24*60*60){
  274. $flag=0;
  275. }else{
  276. $flag=1;
  277. }
  278. }
  279. return $flag;
  280. }
  281. /**
  282. * n周岁的天数
  283. * @param $tyear
  284. * @param $tmonth
  285. * @return int
  286. */
  287. public static function full_year_day($tyear,$tmonth,$type=16){
  288. $sum=365*$type;
  289. for($i=$tyear+1;$i<$tyear+$type;$i++)//考虑中间年份
  290. {
  291. if(self::is_leap_year($i))
  292. $sum++;
  293. }
  294. if(self::is_leap_year($tyear)&&$tmonth<=2)//考虑初末两年
  295. $sum++;
  296. if(self::is_leap_year($tyear+$type)&&$tmonth>=3){
  297. $sum++;
  298. }
  299. return $sum;
  300. }
  301. /**
  302. * @param $year
  303. * @return int 1是闰年,0不是闰年
  304. */
  305. public static function is_leap_year($year){
  306. if(($year%4==0&&$year%100!=0)||$year%400==0)
  307. return 1;
  308. else
  309. return 0;
  310. }
  311. //修改临时工报表审核时间
  312. // static function updateLaborReportVerify($laborReport,$userDutyCheck){
  313. // $date=date('Y-m-d H:i:s');
  314. // $laborReport['verify_at']=$date;
  315. // $laborReport['group_user_id']=$userDutyCheck->group_user_id;
  316. // $laborReport->update();
  317. // return;
  318. // }
  319. // //添加临时工报表数据
  320. // static function createLaborReportData($userDutyCheck){
  321. // $userDetail=UserDetail::find($userDutyCheck->user_id);
  322. // $name=$userDetail['full_name'];
  323. // $mobile_phone=$userDetail['mobile_phone'];
  324. // $identity_number=$userDetail['identity_number'];
  325. // $labor_company_id=UserLabor::where('user_id',$userDutyCheck->user_id)->value('labor_company_id');
  326. // $labor_company=LaborCompany::where('id',$labor_company_id)->value('name');
  327. // if ($userDutyCheck->type=='登入'){
  328. // $check_in_at=$userDutyCheck['checked_at'];
  329. // }
  330. // $date=date('Y-m-d H:i:s');
  331. // $laborReport=new LaborReport([
  332. // 'enter_number'=>Uuid::uuid1(),
  333. // 'user_workgroup_id'=>$userDutyCheck->workgroup_id,
  334. // 'user_id'=>$userDutyCheck->user_id,
  335. // 'name'=>$name,
  336. // 'mobile_phone'=>$mobile_phone,
  337. // 'identity_number'=>$identity_number,
  338. // 'labor_company'=>$labor_company,
  339. // 'check_in_at'=>$check_in_at,
  340. // 'verify_at'=>$date,
  341. // 'group_user_id'=>$userDutyCheck->group_user_id,
  342. // ]);
  343. // $laborReport->save();
  344. // $number_id=$laborReport->id;
  345. // $enter_number=$userDutyCheck->workgroup_id.date ("ymd").str_pad($number_id>99999?$number_id%99999:$number_id,4,"0",STR_PAD_LEFT);
  346. // $laborReport->enter_number=$enter_number;
  347. // $laborReport->update();
  348. // return $laborReport;
  349. // }
  350. // //修改临时工报表数据
  351. // static function updateLaborReportData($laborReport,$userDutyCheck){
  352. // //正常打卡情况
  353. // if($userDutyCheck->type=='登出'){
  354. // $laborReport->check_out_at=$userDutyCheck->checked_at;
  355. // $checkInDate=Carbon::parse($laborReport['check_in_at']);
  356. // $checkOutDate=Carbon::parse($userDutyCheck->checked_at);
  357. // $hour=($checkOutDate->diffInSeconds($checkInDate))/3600; //在线时长
  358. // $laborReport['online_duration']=$hour;
  359. // $laborReport['working_duration']=$hour;
  360. // $laborReport->update();
  361. // }
  362. // $date=Carbon::parse($laborReport['check_in_at'])->format('Y-m-d');
  363. // $userDutyCheckOld=UserDutyCheck::where('user_id',$userDutyCheck->user_id)->orderBy('checked_at','DESC')->limit(10)->first();
  364. // //补卡情况
  365. // if ($userDutyCheck->type=='登入'&&$userDutyCheckOld->checked_at>$userDutyCheck->checked_at&&$userDutyCheck->checked_at<$date." 11:00".":00"){
  366. // $laborReport['check_in_at']=$userDutyCheck['checked_at'];
  367. // $checkInDate=Carbon::parse($laborReport['check_in_at']);
  368. // if ($laborReport->check_out_at){
  369. // $checkOutDate=Carbon::parse($laborReport->check_out_at);
  370. // $hour=($checkOutDate->diffInSeconds($checkInDate))/3600; //在线时长
  371. // $laborReport['online_duration']=$hour;
  372. // }
  373. // $laborReport->update();
  374. // }
  375. // if ($userDutyCheck->type=='登入'&&$userDutyCheckOld->checked_at<$userDutyCheck->checked_at){
  376. // $userDutyCheck->save();
  377. // $laborReport['working_duration']=$laborReport['online_duration'];
  378. // $laborReport->update();
  379. // }
  380. // if ($userDutyCheck->type=='登出'&&$userDutyCheckOld->checked_at<$userDutyCheck->checked_at){
  381. // $laborReport->check_out_at=$userDutyCheck->checked_at;
  382. // $checkInDate=Carbon::parse($laborReport['check_in_at']);
  383. // $checkOutDate=Carbon::parse($userDutyCheck->checked_at);
  384. // $hour=($checkOutDate->diffInSeconds($checkInDate))/3600; //在线时长
  385. // $laborReport['online_duration']=$hour;
  386. // $laborReport['working_duration']=$hour;
  387. // $laborReport->update();
  388. // }
  389. //
  390. // if ($laborReport&&$laborReport->check_out_at){
  391. // $userDutyCheckStart=UserDutyCheck::where('user_id',$laborReport->user_id)->where('workgroup_id',$laborReport->user_workgroup_id)->where('checked_at','>=',$date." 11:00".":00")
  392. // ->where('checked_at','<=',$date." 14:00:00")->where('type','登出')->first();
  393. // $userDutyCheckEnd=UserDutyCheck::where('user_id',$laborReport->user_id)->where('workgroup_id',$laborReport->user_workgroup_id)->where('checked_at','>=',$date." 11:00".":00")
  394. // ->where('checked_at','<=',$date." 14:00:00")->where('type','登入')->first();
  395. // $beginTime=Carbon::parse($userDutyCheckStart['checked_at']);
  396. // $endTime=Carbon::parse($userDutyCheckEnd['checked_at']);
  397. // $lunchHour=($endTime->diffInSeconds($beginTime))/3600;
  398. // if($userDutyCheck->type=='登入'&&$userDutyCheck->checked_at<=$date." 14:00:00"){
  399. // $laborReport['working_duration']=$laborReport['online_duration'];
  400. // }else if($userDutyCheck->type=='登出'&&$userDutyCheck->checked_at<=$date." 14:00:00"){
  401. // $laborReport['working_duration']=$laborReport['online_duration'];
  402. // }else{
  403. // $laborReport['working_duration']=$laborReport['online_duration']-$lunchHour;
  404. // }
  405. // $laborReport->update();
  406. // }
  407. // return;
  408. // }
  409. }