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
3634c3c1
Commit
3634c3c1
authored
Jan 25, 2018
by
clone
Committed by
hujun
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息
parent
4572fa5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
39 deletions
+80
-39
AppChat.php
application/chat/controller/AppChat.php
+21
-10
ChatService.php
application/chat/service/ChatService.php
+18
-1
Agents.php
application/model/Agents.php
+41
-28
No files found.
application/chat/controller/AppChat.php
View file @
3634c3c1
...
...
@@ -107,6 +107,20 @@ class AppChat extends Basic
return
$this
->
response
(
"200"
,
"success"
,
""
);
}
public
function
getUserOrAgentInfo
()
{
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'id'
])
||
!
isset
(
$params
[
'type'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
$params
=
array
(
"id"
=>
1
,
"type"
=>
1
,
//1用户 or 2经纪人
);
$this
->
_chat
->
getUserInfo
();
}
/**
* 发送消息接口
...
...
@@ -160,13 +174,13 @@ class AppChat extends Basic
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'from'
])
||
!
isset
(
$params
[
'target'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
/* $params = array(
'target_type' => 'users', // 消息类型 users 用户消息。chatgroups: 群消息,chatrooms: 聊天室消息
'from' => 'app_64', //发送人
'target' => '18112347151', //接受人
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
/* $params = array(
'target_type' => 'users', // 消息类型 users 用户消息。chatgroups: 群消息,chatrooms: 聊天室消息
'from' => 'app_64', //发送人
'target' => '18112347151', //接受人
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
...
...
@@ -180,7 +194,4 @@ class AppChat extends Basic
}
}
application/chat/service/ChatService.php
View file @
3634c3c1
...
...
@@ -91,7 +91,7 @@ class ChatService
$onlyId
=
""
;
switch
(
$source
)
{
case
1
:
$agentsResult
=
$this
->
agentsModel
->
getAgentsById
(
$userId
);
$agentsResult
=
$this
->
agentsModel
->
getAgentsById
(
"id"
,
$userId
);
if
(
count
(
$agentsResult
)
>
1
)
$onlyId
=
self
::
SOURCE_TYPE_AGENT
.
$userId
;
break
;
...
...
@@ -175,6 +175,23 @@ class ChatService
$this->insertPushLog($sender, $target, $msg_content, $status, $response['statusMsg']);*/
}
public
function
getUserInfo
(
$id
,
$type
)
{
switch
(
$type
)
{
case
1
:
$field
=
"id,"
;
$agentsResult
=
$this
->
agentsModel
->
getAgentsById
(
$field
,
$id
);
break
;
case
2
:
$userResult
=
$this
->
userModel
->
selectUser
(
$id
);
break
;
}
}
/**
* 保存用户发送的消息
* @param $target_type
...
...
application/model/Agents.php
View file @
3634c3c1
...
...
@@ -9,39 +9,38 @@ class Agents extends Model
{
/**
* 查询经纪人
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param string $house_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $field
* @param type $params
* @param type $house_id 查询该街铺和商铺的经纪人评论信息
* @return type
*/
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$house_id
=
''
)
{
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$house_id
=
''
)
{
if
(
$house_id
==
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
$params
)
->
where
(
'level=2 or level=5'
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
$params
)
->
where
(
'level=2 or level=5'
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
'find_in_set('
.
$house_id
.
', house_ids) or find_in_set('
.
$house_id
.
', house_ids2)'
)
->
where
(
$params
)
->
where
(
'level=2 or level=5'
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
'find_in_set('
.
$house_id
.
', house_ids) or find_in_set('
.
$house_id
.
', house_ids2)'
)
->
where
(
$params
)
->
where
(
'level=2 or level=5'
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
return
$data
;
...
...
@@ -104,6 +103,20 @@ class Agents extends Model
return
$data
;
}
/**
* 获取经纪人 by zw
* @param $field
* @param $id
* @return array|false|\PDOStatement|string|Model
*/
public
function
getAgentsById
(
$field
,
$id
)
{
return
$this
->
field
(
$field
)
->
where
(
'inuse = 1 and id = '
.
$id
)
->
find
();
}
/**
* 查询经纪人列表
*
...
...
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