소스 검색

分享图片

Silent 6 년 전
부모
커밋
cac229db56
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/Http/Controllers/TestController.php

+ 2 - 2
app/Http/Controllers/TestController.php

xqd
@@ -15,8 +15,8 @@ class TestController extends Controller
 {
     public function index(Request $request)
     {
-        $items = CheckCard::where('student_id', 7)->whereNotNull('begin_date_time')->whereNotNull('end_date_time')->get()->pluck('begin_date_time')->each(function ($item) {
-            $item = substr($item, 0, 10);
+        $items = CheckCard::where('student_id', 7)->whereNotNull('begin_date_time')->whereNotNull('end_date_time')->get()->pluck('begin_date_time')->map(function ($item) {
+            return substr($item, 0, 10);
         });
         dd($items);
     }