| xqd
@@ -6,6 +6,7 @@ use App\Models\CheckCard;
|
|
|
use App\Models\Content;
|
|
|
use App\Models\Leave;
|
|
|
use App\Models\Remark;
|
|
|
+use App\Models\RemarkDetail;
|
|
|
use App\Models\RemarkTitle;
|
|
|
use App\Models\Setting;
|
|
|
use App\Models\Student;
|
| xqd
@@ -292,11 +293,16 @@ class ApiController extends Controller
|
|
|
foreach($remarks as $key => $value) {
|
|
|
$remark_title = RemarkTitle::find($key);
|
|
|
if(!empty($remark_title) && !empty($value) && $value != 'null') {
|
|
|
- Remark::create([
|
|
|
+ $res = Remark::create([
|
|
|
'course_id' => $student_course->course_id,
|
|
|
'teacher_id' => $student_course_teacher->teacher_id,
|
|
|
'student_id' => $student->id,
|
|
|
]);
|
|
|
+ RemarkDetail::create([
|
|
|
+ 'remark_id' => $res->id,
|
|
|
+ 'question' => $remark_title->name,
|
|
|
+ 'score' => $value,
|
|
|
+ ]);
|
|
|
} else {
|
|
|
return response()->json(['status' => 'fail', 'info' => '评价不能为空']);
|
|
|
}
|