Commit 3140e35e authored by clone's avatar clone

bug

parent 908f91d5
......@@ -83,24 +83,25 @@ class AppChat extends Basic
/* $params = array(
"user_id" => 80,
"mobile" => "15821506182",
"source" => 1, //1经纪人 2用户
"is_self" => 0是 1否
"source" => 1, //1经纪人 2用户
"device_id" => "ssss1231231123123",
"push_id" => "ssss1231231123123"
);*/
if (!isset($params['user_id']) || !isset($params['mobile']) || !isset($params['source']) || !isset($params['push_id'])) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误");
}
$user_id = $params['user_id'];
$mobile = $params['mobile'];
$is_self = $params['is_self'];
$source = $params['source'];
$device_id = $params['device_id'];
$push_id = $params['push_id'];
if (!$user_id || !$mobile || !$source || !$push_id) {
if (!$is_self || !$source || !$user_id || !$mobile) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误");
}
if ($is_self == 0 && (!$device_id || !$push_id)) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误");
}
$only_arr = $this->_chat->register($user_id, $mobile, $source, $device_id, $push_id);
......@@ -322,11 +323,11 @@ class AppChat extends Basic
public function getChatRelation()
{
$params = $this->params;
/* $params = array(
"target" => "agent_5739",
"is_user" => 1,//0用户1经纪人
"relation_list" => '[{"r_id":"13","msg_id":2868},{"r_id":"12","msg_id":2849}]',
);*/
/* $params = array(
"target" => "agent_5739",
"is_user" => 1,//0用户1经纪人
"relation_list" => '[{"r_id":"13","msg_id":2868},{"r_id":"12","msg_id":2849}]',
);*/
if (!isset($params['target']) || !isset($params["is_user"])) {
return $this->response("300", "参数不全");
}
......@@ -337,7 +338,7 @@ class AppChat extends Basic
if (!empty($params["relation_list"])) {
try {
$relation_ = json_decode($params["relation_list"], true);
foreach ($relation_ as $item){
foreach ($relation_ as $item) {
$relation_list[$item["r_id"]][] = $item;
}
} catch (Exception $exception) {
......
......@@ -88,7 +88,7 @@ class ChatService
}
//todo 保存或更新push_id
//todo 1.判断设备id +id 的数据是否存在,存在并且push_id和提交的不同则修改,否者新增
if ($id > 0) {
if ($id > 0 && $device_id && $push_id) {
$this->savePushId($id, $device_id, $push_id);
}
return [ "code" => 200, "only_id" => $only_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