|
|
|
@ -581,7 +581,10 @@ class CourseSignController extends BaseController
|
|
|
|
* @OA\Parameter(name="course_id", in="query", @OA\Schema(type="string"), required=true, description="课程id"),
|
|
|
|
* @OA\Parameter(name="course_id", in="query", @OA\Schema(type="string"), required=true, description="课程id"),
|
|
|
|
* @OA\Parameter(name="ids", in="query", @OA\Schema(type="string"), required=true, description="英文逗号分隔的id数组"),
|
|
|
|
* @OA\Parameter(name="ids", in="query", @OA\Schema(type="string"), required=true, description="英文逗号分隔的id数组"),
|
|
|
|
* @OA\Parameter(name="status", in="query", @OA\Schema(type="string"), required=true, description="状态0待审核1通过2拒绝"),
|
|
|
|
* @OA\Parameter(name="status", in="query", @OA\Schema(type="string"), required=true, description="状态0待审核1通过2拒绝"),
|
|
|
|
* @OA\Parameter(name="reason", in="query", @OA\Schema(type="string"), required=true, description="reason"),
|
|
|
|
* @OA\Parameter(name="reason", in="query", @OA\Schema(type="string"), required=false, description="备注"),
|
|
|
|
|
|
|
|
* @OA\Parameter(name="score", in="query", @OA\Schema(type="integer"), required=false, description="分数"),
|
|
|
|
|
|
|
|
* @OA\Parameter(name="file_ids", in="query", @OA\Schema(type="string"), required=false, description="文件id数组,JSON格式字符串或英文逗号分隔的字符串"),
|
|
|
|
|
|
|
|
* @OA\Parameter(name="giveup_reason", in="query", @OA\Schema(type="string"), required=false, description="放弃原因"),
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
* @OA\Response(
|
|
|
|
* @OA\Response(
|
|
|
|
* response="200",
|
|
|
|
* response="200",
|
|
|
|
@ -614,7 +617,38 @@ class CourseSignController extends BaseController
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
$data = ['course_id' => $all['course_id'], 'course_sign_id' => $id, 'status_text' => CourseSign::$intToString['status'][$all['status']]];
|
|
|
|
$data = ['course_id' => $all['course_id'], 'course_sign_id' => $id, 'status_text' => CourseSign::$intToString['status'][$all['status']]];
|
|
|
|
$model->status = $all['status'];
|
|
|
|
$model->status = $all['status'];
|
|
|
|
$model->reason = $all['reason'] ?? '';
|
|
|
|
|
|
|
|
|
|
|
|
// 更新 reason 备注
|
|
|
|
|
|
|
|
if (isset($all['reason'])) {
|
|
|
|
|
|
|
|
$model->reason = $all['reason'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新 score 分数
|
|
|
|
|
|
|
|
if (isset($all['score'])) {
|
|
|
|
|
|
|
|
$model->score = $all['score'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新 file_ids 文件数组
|
|
|
|
|
|
|
|
if (isset($all['file_ids'])) {
|
|
|
|
|
|
|
|
// 如果传入的是字符串,尝试解析为 JSON
|
|
|
|
|
|
|
|
if (is_string($all['file_ids'])) {
|
|
|
|
|
|
|
|
$fileIds = json_decode($all['file_ids'], true);
|
|
|
|
|
|
|
|
if (json_last_error() === JSON_ERROR_NONE) {
|
|
|
|
|
|
|
|
$model->file_ids = $fileIds;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 如果不是 JSON,可能是逗号分隔的字符串
|
|
|
|
|
|
|
|
$model->file_ids = array_filter(array_map('trim', explode(',', $all['file_ids'])));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} elseif (is_array($all['file_ids'])) {
|
|
|
|
|
|
|
|
$model->file_ids = $all['file_ids'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新 giveup_reason 放弃原因
|
|
|
|
|
|
|
|
if (isset($all['giveup_reason'])) {
|
|
|
|
|
|
|
|
$model->giveup_reason = $all['giveup_reason'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$model->save();
|
|
|
|
$model->save();
|
|
|
|
if ($model->status == 1) {
|
|
|
|
if ($model->status == 1) {
|
|
|
|
Notification::send(User::find($model->user_id), new AuditNotify($data));
|
|
|
|
Notification::send(User::find($model->user_id), new AuditNotify($data));
|
|
|
|
|