Authored by whb

消息列表修改

... ... @@ -93,6 +93,10 @@ trait YHMApi_App_V2_Base {
$backgroup = empty($baseInfo['background_img']) ? YHMConfig_Image::USER_BACKGROUD_IMG : $baseInfo['background_img'];
$gender = empty($baseInfo['gender']) ? 0 : $baseInfo['gender'];
$area_code = empty($baseInfo['area_code']) ? 0 : $baseInfo['area_code'];
if(empty($baseInfo['introduce']))
{
$baseInfo['introduce'] = '';
}
return array(
'uid' => $uid,
'nick_name' => $baseInfo['nick_name'],
... ...
... ... @@ -41,37 +41,6 @@ class YHMApi_App_V2_Messages extends YHMApi_App_V1_Messages {
),
'from_uid' => 0,
);
//系统消息
$mquery = array(
'to_uid' => (int) $params['uid'],
'delete_list' => array(
'$not' => array(
'$in' => array((int) $params['uid'])
)
),
'from_uid' => 0,
);
$systemMess = Q_Db::mongo('MessageLoggers')->collection('Message')->find($mquery)->sort(array(
'time' => -1))->limit(1);
foreach ($systemMess as $mess)
{
$mlist = YHMIm_Agreement::format($mess, $params['uid'])->getMongoToTalk();
}
$countArr = $mongo->find($query);
$mlist['unread_number'] = 0;
foreach ($countArr as $k => $v)
{
$mlist['unread_number']+= $v['unread_number'];
}
if (empty($mlist['time']))
{
$list['system'] = null;
}
else
{
$list['system'] = $mlist;
}
####################################################
$query['from_uid'] = array('$gt' => 0);
$talkMess = $mongo->find($query)->sort(array(
... ... @@ -400,10 +369,15 @@ class YHMApi_App_V2_Messages extends YHMApi_App_V1_Messages {
'from_uid' => 0,
'participator' => (int) $params['uid']
));
$systemUnread = 0;
foreach($systemTalk as $talk)
{
$systemUnread += $talk['unread_number'];
}
$seenData = array(
'unread_total_number' => 0,
'talk_unread' => array(),
'system_unread_total_number' => $systemTalk['unread_number'],
'system_unread_total_number' => $systemUnread,
);
foreach ($_seenData as $mess)
{
... ...