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
a20e23e1
Commit
a20e23e1
authored
Jul 08, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getAgentByUserId
parent
9d323c74
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
5 deletions
+26
-5
OfficeOrderLogService.php
application/api_broker/service/OfficeOrderLogService.php
+1
-1
OrderLogService.php
application/api_broker/service/OrderLogService.php
+1
-1
AppChat.php
application/chat/controller/AppChat.php
+1
-1
UserAgentModel.php
application/model/UserAgentModel.php
+1
-2
Users.php
application/model/Users.php
+22
-0
No files found.
application/api_broker/service/OfficeOrderLogService.php
View file @
a20e23e1
...
...
@@ -1550,7 +1550,7 @@ class OfficeOrderLogService
$userModel
=
new
Users
();
$where_user
[
"a.id"
]
=
$result
[
0
][
"user_id"
];
$where_user
[
"b.status"
]
=
0
;
$user_data
=
$userModel
->
getAgent
ByUserId
(
$field
,
$where_user
);
$user_data
=
$userModel
->
getAgent
User
(
$field
,
$where_user
);
//客方
if
(
isset
(
$user_data
[
0
][
'id'
]))
{
...
...
application/api_broker/service/OrderLogService.php
View file @
a20e23e1
...
...
@@ -1683,7 +1683,7 @@ class OrderLogService
$userModel
=
new
Users
();
$where_user
[
"a.id"
]
=
$result
[
0
][
"user_id"
];
$where_user
[
"b.status"
]
=
0
;
$user_data
=
$userModel
->
getAgent
ByUserId
(
$field
,
$where_user
);
$user_data
=
$userModel
->
getAgent
User
(
$field
,
$where_user
);
//客方
if
(
isset
(
$user_data
[
0
][
'id'
]))
{
...
...
application/chat/controller/AppChat.php
View file @
a20e23e1
...
...
@@ -450,7 +450,7 @@ class AppChat extends Basic
$user
=
new
Users
();
$field
=
'a.id,a.user_name,a.user_nick,a.user_phone,a.user_pic,a.other_pic'
;
$params_
[
"a.id"
]
=
$params
[
'id'
];
$result
=
$user
->
getAgent
ByUserId
(
$field
,
$params_
);
$result
=
$user
->
getAgent
User
(
$field
,
$params_
);
if
(
count
(
$result
)
>
0
)
{
$result_
[
"id"
]
=
$result
[
0
][
"id"
];
$result_
[
"agent_id"
]
=
'agent_'
.
$result
[
0
][
"id"
];
...
...
application/model/UserAgentModel.php
View file @
a20e23e1
...
...
@@ -117,8 +117,7 @@ class UserAgentModel extends Model
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
$result
=
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"u_user_agent c"
,
"a.id=c.user_id"
,
"left"
)
->
join
(
"a_agents b"
,
"c.agent_id=b.id"
,
"left"
)
...
...
application/model/Users.php
View file @
a20e23e1
...
...
@@ -780,6 +780,13 @@ class Users extends Model
->
count
();
}
/**
* 废弃
*
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAgentByUserId
(
$field
,
$params
)
{
return
Db
::
name
(
$this
->
table
)
...
...
@@ -1119,5 +1126,20 @@ class Users extends Model
->
limit
(
1
)
->
select
();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAgentUser
(
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"u_user_agent c"
,
"a.id = c.user_id"
,
"left"
)
->
join
(
"a_agents b"
,
"c.agent_id=b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
}
}
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