|
@ -64,13 +64,13 @@ class TopicRepo {
|
|
|
if(status==10){
|
|
|
args.push(userId,status,page,size);
|
|
|
sql = "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? ORDER BY create_time DESC limit ?,?";
|
|
|
}else{
|
|
|
args.push(userId,status,reply,page,size);
|
|
|
sql = "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? and t.reply=? ORDER BY create_time DESC limit ?,?";
|
|
|
}
|
|
@ -98,13 +98,13 @@ class TopicRepo {
|
|
|
if(status==10){
|
|
|
args.push(userId,status,page,size);
|
|
|
sql = "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? AND c.type not in ('6','8') ORDER BY create_time DESC limit ?,?";
|
|
|
}else{
|
|
|
args.push(userId,status,reply,page,size);
|
|
|
sql = "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? and t.reply=? AND c.type not in ('6','8') ORDER BY create_time DESC limit ?,?";
|
|
|
}
|
|
@ -143,13 +143,13 @@ class TopicRepo {
|
|
|
if(status==10){
|
|
|
args.push(userId,status,type,page,size);
|
|
|
sql = "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? AND c.type =? "+tempParms+" ORDER BY create_time DESC limit ?,?";
|
|
|
}else{
|
|
|
args.push(userId,status,reply,type,page,size);
|
|
|
sql = "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? and t.reply=? AND c.type = ? "+tempParms+" ORDER BY create_time DESC limit ?,?";
|
|
|
}
|
|
@ -186,13 +186,13 @@ class TopicRepo {
|
|
|
if(status==10){
|
|
|
args.push(userId,status,type);
|
|
|
sql = "SELECT count(t.id) count FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? AND c.type =? "+tempParms;
|
|
|
}else{
|
|
|
args.push(userId,status,reply,type);
|
|
|
sql = "SELECT count(t.id) count FROM "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
|
|
|
DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
|
|
|
"WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
|
|
|
"AND d.id in (?) AND t. STATUS = ? and t.reply=? AND c.type = ? "+tempParms;
|
|
|
}
|