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