haozi 6 лет назад
Родитель
Сommit
2e592a8db1

+ 10 - 5
app/Http/Controllers/LaborReportController.php

@@ -77,11 +77,16 @@ class LaborReportController extends Controller
                 ->where('checked_at','<=',$date." 14:00:00")->where('type','登出')->first();
             $userDutyCheckEnd=UserDutyCheck::where('user_id',$laborReport->user_id)->where('workgroup_id',$laborReport->user_workgroup_id)->where('checked_at','>=',$date." 11:00".":00")
                 ->where('checked_at','<=',$date." 14:00:00")->where('type','登入')->first();
-            $laborReport->beginLunch=date('H:i',strtotime($userDutyCheckStart['checked_at']));
-            $laborReport->endLunch=date('H:i',strtotime($userDutyCheckEnd['checked_at']));
-            $beginTime=Carbon::parse($laborReport->beginLunch);
-            $endTime=Carbon::parse($laborReport->endLunch);
-            $hour=($endTime->diffInSeconds($beginTime))/3600;
+            if ($userDutyCheckStart['checked_at']==null){
+                $laborReport->beginLunch=null;
+            }else{
+                $laborReport->beginLunch=date('H:i',strtotime($userDutyCheckStart['checked_at']));
+            }
+            if ($userDutyCheckEnd['checked_at']==null){
+                $laborReport->endLunch=null;
+            }else{
+                $laborReport->endLunch=date('H:i',strtotime($userDutyCheckEnd['checked_at']));
+            }
         }
         $userWorkGroups=UserWorkgroup::select('id','name')->get();
         return view('personnel/laborReport/index',['laborReports'=>$laborReports,'userWorkGroups'=>$userWorkGroups,]);

BIN
public/images/QRCodeIMG/1.png


BIN
public/images/QRCodeIMG/2.png


BIN
public/images/QRCodeIMG/3.png


BIN
public/images/QRCodeIMG/5.png


+ 10 - 9
resources/views/personnel/laborReport/index.blade.php

@@ -117,19 +117,20 @@
                             <td>@{{ i+1  }}</td>
                             <td class="text-muted">@{{laborReport.id}}</td>
                             <td class="text-muted">@{{laborReport.created_at}}</td>
-                            <td>@{{laborReport.enterNumber}}</td>
-                            <td>@{{laborReport.userWorkGroupName}}</td>
+                            <td class="text-muted">@{{laborReport.enterNumber}}</td>
+                            <td class="text-muted">@{{laborReport.userWorkGroupName}}</td>
                             <td class="text-muted">@{{laborReport.name}}</td>
                             <td class="text-muted">@{{laborReport.mobilePhone}}</td>
                             <td class="text-muted">@{{laborReport.identityNumber}}</td>
-                            <td>@{{laborReport.laborCompany}}</td>
-                            <td>@{{laborReport.checkInAt}}</td>
-                            <td>@{{laborReport.verifyAt}}</td>
-                            <td v-if="laborReport.verifyPerson">@{{laborReport.verifyPerson}}</td>
+                            <td class="text-muted">@{{laborReport.laborCompany}}</td>
+                            <td class="text-muted">@{{laborReport.checkInAt}}</td>
+                            <td class="text-muted">@{{laborReport.verifyAt}}</td>
+                            <td class="text-muted" v-if="laborReport.verifyPerson">@{{laborReport.verifyPerson}}</td>
                             <td class="text-muted">@{{laborReport.checkOutAt}}</td>
-                            <td v-if="laborReport.beginLunch!=laborReport.endLunch">@{{laborReport.beginLunch}}-@{{laborReport.endLunch}}</td>
-                            <td class="text-muted">@{{laborReport.onlineDuration}}</td>
-                            <td class="text-muted">@{{laborReport.workingDuration}}</td>
+                            <td class="text-muted" v-if="laborReport.beginLunch&laborReport.endLunch">@{{laborReport.beginLunch}}-@{{laborReport.endLunch}}</td>
+                            <td v-else="laborReport.endLunch"></td>
+                            <td class="text-muted" v-if="laborReport.onlineDuration">@{{laborReport.onlineDuration}}</td>
+                            <td class="text-muted" v-if="laborReport.workingDuration">@{{laborReport.workingDuration}}</td>
                         </tr>
                     </table>
                 </div>