|
|
@ -1436,7 +1436,6 @@ class UserController extends BaseController
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function user_info()
|
|
|
|
public function user_info()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
C(api('Config/lists'));
|
|
|
|
C(api('Config/lists'));
|
|
|
|
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
|
|
|
|
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
|
|
|
|
$model = M("user", "tab_");
|
|
|
|
$model = M("user", "tab_");
|
|
|
@ -1462,8 +1461,23 @@ class UserController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$unread_count = 0;
|
|
|
|
$unread_count = 0;
|
|
|
|
$unread_count += M('share_record', 'tab_') -> where(['invite_id' => $data['id'], 'award_coin' => ['gt', 0], 'read' => 0]) -> count();
|
|
|
|
|
|
|
|
$unread_count += M('point_record', 'tab_') -> where(['type_id' => 6, 'user_id' => $data['id'], 'point' => ['gt', 0], 'read' => 0]) -> count();
|
|
|
|
//获取公告未读条数
|
|
|
|
|
|
|
|
$time = time();
|
|
|
|
|
|
|
|
$notice = M('notice', 'tab_')->where('start_time < ' .$time. ' AND (end_time = 0 OR end_time >' . $time . ')')->getField('id',true);
|
|
|
|
|
|
|
|
if(!empty($notice))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$unread_count += count($notice);
|
|
|
|
|
|
|
|
$where['notice_id'] = ['in', implode(',', $notice)];
|
|
|
|
|
|
|
|
$where['user_id'] = $user['user_id'];
|
|
|
|
|
|
|
|
$where['is_read'] = 1;
|
|
|
|
|
|
|
|
$notice_read_count = M('notice_read', 'tab_')->where($where)->count();
|
|
|
|
|
|
|
|
$unread_count -= $notice_read_count;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// //邀请奖励消息未读条数
|
|
|
|
|
|
|
|
// $unread_count += M('share_record', 'tab_') -> where(['invite_id' => $data['id'], 'award_coin' => ['gt', 0], 'read' => 0]) -> count();
|
|
|
|
|
|
|
|
// //积分奖励消息条数
|
|
|
|
|
|
|
|
// $unread_count += M('point_record', 'tab_') -> where(['type_id' => 6, 'user_id' => $data['id'], 'point' => ['gt', 0], 'read' => 0]) -> count();
|
|
|
|
$data['notice_count'] = $unread_count;
|
|
|
|
$data['notice_count'] = $unread_count;
|
|
|
|
$buddies_request = get_buddies_unagree_count($data['id']);
|
|
|
|
$buddies_request = get_buddies_unagree_count($data['id']);
|
|
|
|
$data['request_count'] = $buddies_request;
|
|
|
|
$data['request_count'] = $buddies_request;
|
|
|
|