Commit 046f2cbb authored by christ's avatar christ

message

parent 8623f0ec
...@@ -241,7 +241,6 @@ $tcp_server->on('receive', function($serv, $fd, $from_id, $data) use($conf) { ...@@ -241,7 +241,6 @@ $tcp_server->on('receive', function($serv, $fd, $from_id, $data) use($conf) {
if(!isset($data['uid']) || empty($data['uid'])){ if(!isset($data['uid']) || empty($data['uid'])){
foreach($data['data'] as $value){ foreach($data['data'] as $value){
if(isset($value['type'])&&$value['type']>100){ if(isset($value['type'])&&$value['type']>100){
echo json_encode($value);
$sendStoreFd=$redis->hGet(KEY_PRE_STORE.$value['storeId'],'fd'); $sendStoreFd=$redis->hGet(KEY_PRE_STORE.$value['storeId'],'fd');
if(!empty($sendStoreFd)){ if(!empty($sendStoreFd)){
if(!$value['message']){ if(!$value['message']){
...@@ -303,8 +302,8 @@ $serv->on('Close', function($server, $fd) use($conf){ ...@@ -303,8 +302,8 @@ $serv->on('Close', function($server, $fd) use($conf){
}); });
function responseJson($status = 1,$method, $message = '', $data = array()) { function responseJson($status = 1,$method, $message = '', $data = array()) {
if(!$message){ if(!$data['message']){
$message=new \stdClass(); $data['message']=new \stdClass();
} }
$data = [ $data = [
'status' => $status, 'status' => $status,
...@@ -312,6 +311,7 @@ function responseJson($status = 1,$method, $message = '', $data = array()) { ...@@ -312,6 +311,7 @@ function responseJson($status = 1,$method, $message = '', $data = array()) {
'message' => $message, 'message' => $message,
'data' => $data, 'data' => $data,
]; ];
echo json_encode($data);
return json_encode($data); return json_encode($data);
} }
$serv->start(); $serv->start();
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