|
@@ -85,12 +85,12 @@ class ApiController extends Controller
|
|
public function startCheckCard(Request $request)
|
|
public function startCheckCard(Request $request)
|
|
{
|
|
{
|
|
if(empty($request->input('student_id')) || empty($student = Student::find($request->input('student_id')))) {
|
|
if(empty($request->input('student_id')) || empty($student = Student::find($request->input('student_id')))) {
|
|
- return back()->json(['status' => 'fail', 'info' => '找不到学员']);
|
|
|
|
|
|
+ return response()->json(['status' => 'fail', 'info' => '找不到学员']);
|
|
}
|
|
}
|
|
|
|
|
|
$student_course = StudentCourse::where('student_id', $student->id)->first();
|
|
$student_course = StudentCourse::where('student_id', $student->id)->first();
|
|
if(empty($student_course)) {
|
|
if(empty($student_course)) {
|
|
- return back()->json(['status' => 'fail', 'info' => '暂无课程']);
|
|
|
|
|
|
+ return response()->json(['status' => 'fail', 'info' => '暂无课程']);
|
|
}
|
|
}
|
|
|
|
|
|
$res = CheckCard::create([
|
|
$res = CheckCard::create([
|
|
@@ -101,8 +101,8 @@ class ApiController extends Controller
|
|
]);
|
|
]);
|
|
|
|
|
|
if(empty($res)) {
|
|
if(empty($res)) {
|
|
- return back()->json(['status' => 'fail', 'info' => '创建失败']);
|
|
|
|
|
|
+ return response()->json(['status' => 'fail', 'info' => '创建失败']);
|
|
}
|
|
}
|
|
- return back()->json(['status' => 'success', 'info' => '操作成功']);
|
|
|
|
|
|
+ return response()->json(['status' => 'success', 'info' => '操作成功']);
|
|
}
|
|
}
|
|
}
|
|
}
|