|
@ -87,7 +87,8 @@ class SearchRepo {
|
|
* @param handler
|
|
* @param handler
|
|
*/
|
|
*/
|
|
static searchUser(sessionIdList, keyword, userTable, page, size, handler) {
|
|
static searchUser(sessionIdList, keyword, userTable, page, size, handler) {
|
|
let sql = "SELECT DISTINCT u.id, u.name, u.sex, u.birthdate, u.avatar %s FROM sessions s, participants p, " + userTable +
|
|
|
|
|
|
let sql = "SELECT DISTINCT s.id session_id, s.name session_name, s.type session_type, s.business_type, u.id user_id, u.name user_name, u.sex, u.birthdate, u.avatar %s" +
|
|
|
|
" FROM sessions s, participants p, " + userTable +
|
|
" u WHERE s.id in (?) AND s.id = p.session_id AND p.participant_id = u.id AND u.name like ? limit ?, ?";
|
|
" u WHERE s.id in (?) AND s.id = p.session_id AND p.participant_id = u.id AND u.name like ? limit ?, ?";
|
|
|
|
|
|
sql = vsprintf(sql, [userTable == DB_TABLES.Doctors ? ', hospital_name' : '']);
|
|
sql = vsprintf(sql, [userTable == DB_TABLES.Doctors ? ', hospital_name' : '']);
|