|
@@ -105,15 +105,40 @@ class talks_helper
|
|
|
foreach ($items as $room) {
|
|
|
$rooms[] = intval($room['room_id']);
|
|
|
}
|
|
|
-// $items = $this->mod_room->getRooms(['type' => proto_type::room_chat, 'room_id'=>['in',$rooms]]);
|
|
|
- $items = $this->mod_room->getRooms(['room_id'=>['in',$rooms]]);
|
|
|
+ $items = $this->mod_room->getRooms(['type' => proto_type::room_chat, 'room_id'=>['in',$rooms]]);
|
|
|
+// $items = $this->mod_room->getRooms(['room_id'=>['in',$rooms]]);
|
|
|
if(empty($items)) return [];
|
|
|
|
|
|
$result = [];
|
|
|
foreach ($items as $item) {
|
|
|
$roomids[] = intval($item['room_id']);
|
|
|
$info = new base_info($item);
|
|
|
- $result[] = $info->format();
|
|
|
+ $room_info = $info->format();
|
|
|
+
|
|
|
+
|
|
|
+ ////////todo test make test room_name
|
|
|
+ if(empty($room_info["name"]))
|
|
|
+ {
|
|
|
+ $member = Model('room')->table('room_participant')->field('member_id')->distinct(true)->where(["room_id"=>$room_info["room_id"]])->limit(4)->select();
|
|
|
+ $uids = [];
|
|
|
+ foreach ($member as $one){
|
|
|
+ $uids[] = $one['member_id'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $names = Model('member')->field('member_nickname')->where(["member_id",["in",$uids]])->select();
|
|
|
+ foreach ($names as $name){
|
|
|
+ $room_info["name"] .= $name .'、';
|
|
|
+ }
|
|
|
+
|
|
|
+ $room_info["name"] = trim($room_info["name"],"、");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(empty($room_info["avatar"])){
|
|
|
+ $room_info["avatar"] = "http://wx.qlogo.cn/mmopen/cTcqoIpA3hc3DYFZJ0C9tpBA79rTdFPpTI4G5ib8wxSnbYy4nxPiaVHXXPjfLA0cfnhAJTsMQicJSsLDyIOgf06vYFiaE4657hpD/0";
|
|
|
+ }
|
|
|
+ ////////
|
|
|
+
|
|
|
+ $result[] = $room_info;
|
|
|
}
|
|
|
|
|
|
return $result;
|