Silent 6 年之前
父节点
当前提交
ee792c6e5c
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      app/Http/Controllers/WeChat/ApiController.php

+ 8 - 1
app/Http/Controllers/WeChat/ApiController.php

xqd
@@ -349,7 +349,14 @@ class ApiController extends Controller
         $this_week_begin = $today->toDateTimeString();
         $this_week_end = $today->addDays(7)->toDateTimeString();
 
-        return response()->json(['status' => 'success', 'courseInfo' => $student_course]);
+        $tmp = Remark::where([
+            ['student_id', '=', $student->id],
+            ['created_at', '>=', $this_week_begin],
+            ['created_at', '<', $this_week_end],
+        ])->first();
+        $is_new = empty($tmp) ? true : false;
+
+        return response()->json(['status' => 'success', 'courseInfo' => $student_course, 'is_new' => $is_new]);
     }
 
     public function getMyLearnInfo(Request $request)