Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
ff3e3891
Commit
ff3e3891
authored
Jul 22, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
b8471731
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
2 deletions
+45
-2
AppChat.php
application/chat/controller/AppChat.php
+44
-0
route.php
application/route.php
+1
-2
No files found.
application/chat/controller/AppChat.php
View file @
ff3e3891
...
...
@@ -92,6 +92,50 @@ class AppChat extends Basic
if
(
!
isset
(
$params
[
'is_self'
])
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'mobile'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
/*if ($params['is_self'] == 1 && (!isset($params['device_id']) || !isset($params['push_id']))) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误1");
}*/
$user_id
=
$params
[
'user_id'
];
$mobile
=
$params
[
'mobile'
];
$source
=
$params
[
'source'
];
$device_id
=
!
isset
(
$params
[
'device_id'
])
?
null
:
$params
[
'device_id'
];
$push_id
=
!
isset
(
$params
[
'push_id'
])
?
null
:
$params
[
'push_id'
];
$only_arr
=
$this
->
_chat
->
register
(
$user_id
,
$mobile
,
$source
,
$device_id
,
$push_id
);
if
(
$only_arr
[
"code"
]
==
200
)
{
return
$this
->
response
(
"200"
,
"success"
,
[
"only_id"
=>
$only_arr
[
"only_id"
]
]);
}
else
{
return
$this
->
response
(
"101"
,
$only_arr
[
"msg"
]);
}
}
/**
* 验证用户角色,生成唯一id
* @return \think\Response
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
userChatV2
()
{
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 80,
"mobile" => "15821506182",
"is_self" => 1,//1是 2否
"source" => 1, //1经纪人 2用户
"device_id" => "ssss1231231123123",
"push_id" => "ssss1231231123123"
);*/
if
(
!
isset
(
$params
[
'is_self'
])
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'mobile'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
if
(
$params
[
'is_self'
]
==
1
&&
(
!
isset
(
$params
[
'device_id'
])
||
!
isset
(
$params
[
'push_id'
])))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误1"
);
}
...
...
application/route.php
View file @
ff3e3891
...
...
@@ -238,7 +238,6 @@ Route::group('index', [
'receiptImgList'
=>
[
'index/Collection/receiptImgList'
,
[
'method'
=>
'post|get'
]
],
//收款列表-收款图片列表
'getTaxesById'
=>
[
'index/Finance/getTaxesById'
,
[
'method'
=>
'POST|GET'
]
],
//财务结单
'financeUpdateLog'
=>
[
'index/Finance/financeUpdateLog'
,
[
'method'
=>
'POST|GET'
]
],
//财务结单
'noticeIndex'
=>
[
'index/notice/index'
,
[
'method'
=>
'GET'
]
],
//公告列表
...
...
@@ -264,7 +263,6 @@ Route::group('index', [
'inspectionRecordList'
=>
[
'index/InspectionRecord/inspectionRecordList'
,
[
'method'
=>
'GET'
]
],
//约带看记录liu
]);
...
...
@@ -345,6 +343,7 @@ Route::group('api', [
Route
::
group
(
'chat'
,
[
'index'
=>
[
'chat/AppChat/index'
,
[
'method'
=>
'get'
]
],
'userChat'
=>
[
'chat/AppChat/userChat'
,
[
'method'
=>
'post|get'
]
],
'userChatV2'
=>
[
'chat/AppChat/userChatV2'
,
[
'method'
=>
'post|get'
]
],
'pushMsg'
=>
[
'chat/AppChat/pushMsg'
,
[
'method'
=>
'post|get'
]
],
'getChatHistory'
=>
[
'chat/AppChat/getChatHistory'
,
[
'method'
=>
'post|get'
]
],
'getUserOrAgentInfo'
=>
[
'chat/AppChat/getUserOrAgentInfo'
,
[
'method'
=>
'post|get'
]
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment