Commit 68f0e92d authored by hujun's avatar hujun

user_id

parent ba08136c
......@@ -217,7 +217,7 @@ class ChatService
$where['type'] = 1;
}
$info = $userExt->getChatUserExtByUserId($where, 'a.id,a.ext_id,a.device_id,a.push_id');
$info = $userExt->getChatUserExtByUserId($where, 'a.id,a.ext_id,a.device_id,a.push_id,a.user_id');
if (count($info) <= 0) {
return false;
......@@ -226,7 +226,7 @@ class ChatService
foreach ($info as $item) {
array_push($push_id, $item["push_id"]);
}
$rPush->send($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $accessToken, [ $this, 'saveSendStatus' ], $push_id, $msg_id);
$rPush->send($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $accessToken, [ $this, 'saveSendStatus' ], $push_id, $msg_id, $info[0]['user_id']);
return true;
}
......
......@@ -30,8 +30,9 @@ class RPush
* @param $callback
* @param $push_id
* @param $msg_id
* @param $user_id
*/
public function send($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $access_token, $callback, $push_id, $msg_id)
public function send($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $access_token, $callback, $push_id, $msg_id, $user_id)
{
//todo
if (Cache::get('save_message_num')) {
......@@ -47,7 +48,7 @@ class RPush
Cache::set('save_message_num', 0);
}
$response = $this->sendRequestByCurl($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $access_token, $push_id, $msg_id);
$response = $this->sendRequestByCurl($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $access_token, $push_id, $msg_id,$user_id);
call_user_func_array([ $callback[0], $callback[1] ], [ $response, $target, $from, $msg_content ]);
}
......@@ -63,9 +64,11 @@ class RPush
* @param $type
* @param $access_token
* @param $push_id
* @param $message_id
* @param $user_id
* @return array
*/
public function sendRequestByCurl($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $access_token, $push_id, $message_id)
public function sendRequestByCurl($user_name, $target_type, $target, $msg_content, $from, $is_user, $type, $access_token, $push_id, $message_id,$user_id)
{
$title = "收到一条消息";
......@@ -87,7 +90,8 @@ class RPush
'to_id' => $target,
'from_id' => $from,
'created_at' => date('Y-m-d H:i:s'),
'message_id' => $message_id
'message_id' => $message_id,
'user_id' => $user_id
]
));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment