|  | @ -127,7 +127,7 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                 modelUtil.emitData(self.eventEmitter, data);
 | 
	
		
			
				|  |  |             });
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(type==2){
 | 
	
		
			
				|  |  |         if(type==3){
 | 
	
		
			
				|  |  |             searchRepo.searchPatientPM(userId, keyword, function (err, chats) {
 | 
	
		
			
				|  |  |                 if (err) {
 | 
	
		
			
				|  |  |                     log.error("Search patient on private messages failed: ", err);
 | 
	
	
		
			
				|  | @ -152,7 +152,7 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                 modelUtil.emitData(self.eventEmitter, data);
 | 
	
		
			
				|  |  |             });
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(type==3){
 | 
	
		
			
				|  |  |         if(type==2){
 | 
	
		
			
				|  |  |             searchRepo.searchGroupPatients(userId, keyword, function (err, groups) {
 | 
	
		
			
				|  |  |                 if (err) {
 | 
	
		
			
				|  |  |                     modelUtil.emitDbError(self.eventEmitter, "Search talk group failed", err);
 | 
	
	
		
			
				|  | @ -186,7 +186,7 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |         searchRepo.searchPatientPMList(userId, keyword,groupId,type, function (err, chats) {
 | 
	
		
			
				|  |  |             var data = [];
 | 
	
		
			
				|  |  |             if (err) {
 | 
	
		
			
				|  |  |                 log.error("Search patient on private messages failed: ", err);
 | 
	
		
			
				|  |  |                 log.error("Search searchPatientPMList on private messages failed: ", err);
 | 
	
		
			
				|  |  |                 res.status(500).send({message: "Search patient on private messages failed."});
 | 
	
		
			
				|  |  |                 return;
 | 
	
		
			
				|  |  |             }
 | 
	
	
		
			
				|  | @ -226,7 +226,7 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                 data.doctors.push({
 | 
	
		
			
				|  |  |                     code: doctor.code,
 | 
	
		
			
				|  |  |                     name: doctor.name,
 | 
	
		
			
				|  |  |                     hospitalName:doctor.name,
 | 
	
		
			
				|  |  |                     hospitalName:doctor.hospital_name,
 | 
	
		
			
				|  |  |                     sex: doctor.sex,
 | 
	
		
			
				|  |  |                     avatar: doctor.photo === null ? "" : doctor.photo
 | 
	
		
			
				|  |  |                 });
 | 
	
	
		
			
				|  | @ -246,6 +246,7 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                             code: t.code,
 | 
	
		
			
				|  |  |                             name: t.name,
 | 
	
		
			
				|  |  |                             members: t.con,
 | 
	
		
			
				|  |  |                             groupType:t.group_type
 | 
	
		
			
				|  |  |                         };
 | 
	
		
			
				|  |  |                         data.groups.push(group);
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -264,7 +265,8 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                             amount: t.amount,
 | 
	
		
			
				|  |  |                             content:t.content,
 | 
	
		
			
				|  |  |                             type:t.type,
 | 
	
		
			
				|  |  |                             msg_id:t.msg_id
 | 
	
		
			
				|  |  |                             msg_id:t.msg_id,
 | 
	
		
			
				|  |  |                             groupType:t.group_type
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         };
 | 
	
		
			
				|  |  |                         data.content.push(message);
 | 
	
	
		
			
				|  | @ -309,6 +311,7 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                         code: t.code,
 | 
	
		
			
				|  |  |                         name: t.name,
 | 
	
		
			
				|  |  |                         members: t.con,
 | 
	
		
			
				|  |  |                         groupType:t.group_type
 | 
	
		
			
				|  |  |                     };
 | 
	
		
			
				|  |  |                     data.push(group);
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -329,8 +332,8 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                         amount: t.amount,
 | 
	
		
			
				|  |  |                         content:t.content,
 | 
	
		
			
				|  |  |                         type:t.type,
 | 
	
		
			
				|  |  |                         msg_id:t.msg_id
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         msg_id:t.msg_id,
 | 
	
		
			
				|  |  |                         groupType:t.group_type
 | 
	
		
			
				|  |  |                     };
 | 
	
		
			
				|  |  |                     data.push(message);
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -360,7 +363,8 @@ class Search extends BaseModel{
 | 
	
		
			
				|  |  |                         code: doctor.code,
 | 
	
		
			
				|  |  |                         name: doctor.name,
 | 
	
		
			
				|  |  |                         content:doctor.content,
 | 
	
		
			
				|  |  |                         msg_id:t.msg_id
 | 
	
		
			
				|  |  |                         msg_id:t.msg_id,
 | 
	
		
			
				|  |  |                         groupType:t.group_type
 | 
	
		
			
				|  |  |                     });
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 modelUtil.emitData(self.eventEmitter, data);
 |