...
|
...
|
@@ -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)
|
|
|
{
|
...
|
...
|
|