leiyun 3 settimane fa
parent
commit
8b5d4dafeb
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. +6
    -1
      src/controller/mp.js

+ 6
- 1
src/controller/mp.js Vedi File

@@ -93,7 +93,12 @@ module.exports = class extends Base {
patient = await this.model('patient')
.field('id, patient_no, name, phone, status, auth_status')
.where({ id: user.patient_id, is_deleted: 0 }).find();
if (think.isEmpty(patient)) patient = null;
if (think.isEmpty(patient)) {
// 关联的患者已被删除,清除关联
await userModel.where({ id: user.id }).update({ patient_id: 0 });
user.patient_id = 0;
patient = null;
}
}
return this.json({ code: 0, data: { token, userInfo: {
id: user.id, nickname: user.nickname || '', avatar: user.avatar || '',


Caricamento…
Annulla
Salva