|
@@ -23,7 +23,7 @@ class LessonStudentService extends CrudService {
|
|
|
async beforeCreate(body) {
|
|
|
const { lesson_id, school_id, student_id } = body;
|
|
|
// 检查是否已经有数据
|
|
|
- const data = await this.model.findOne({ lesson_id, school_id, student_id });
|
|
|
+ const data = await this.model.findOne({ lesson_id, school_id, student_id, $or: [{ is_try: '0', is_pay: { $ne: '-3' } }, { is_try: '1' }] });
|
|
|
// 数据已存在
|
|
|
if (data) throw new BusinessError(ErrorCode.DATA_EXISTED, '您已报名');
|
|
|
// 数据不存在
|