|
@@ -26,7 +26,9 @@ class StudentService extends CrudService {
|
|
|
}
|
|
|
|
|
|
async create(data) {
|
|
|
- const { name, phone: mobile, gender } = data;
|
|
|
+ const { name, phone: mobile, gender, id_number } = data;
|
|
|
+ const count = await this.model.count({ id_number });
|
|
|
+ if (count) throw new BusinessError(ErrorCode.DATA_EXISTED, '该身份证号已存在,若未发现错误,请联系开发人员查证');
|
|
|
const res = await this.model.create(data);
|
|
|
if (res) {
|
|
|
const obj = {
|