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
d172700d
Commit
d172700d
authored
Jan 25, 2018
by
clone
Committed by
hujun
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量查询经纪人或者会员的信息
parent
b96e20de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
33 deletions
+61
-33
AppChat.php
application/chat/controller/AppChat.php
+4
-4
ChatService.php
application/chat/service/ChatService.php
+47
-26
curl_cookie.txt
application/chat/utils/curl_cookie.txt
+1
-1
Users.php
application/model/Users.php
+9
-2
No files found.
application/chat/controller/AppChat.php
View file @
d172700d
...
...
@@ -105,12 +105,12 @@ class AppChat extends Basic
{
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'only_id'
])
&&
!
isset
(
$params
[
'phone'
])
||
!
isset
(
$params
[
'typ
e'
]))
{
if
(
!
isset
(
$params
[
'only_id'
])
||
!
isset
(
$params
[
'phone'
])
||
!
isset
(
$params
[
'sourc
e'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
/* $params = array(
"only_id" => "user_
66
",
"phone" => "13
817616471
",
"only_id" => "user_
72,agent_10
",
"phone" => "13
112341234
",
"source" => 2,// 1经纪人 or 2用户
);*/
$only_id
=
isset
(
$params
[
'only_id'
])
?
$params
[
'only_id'
]
:
0
;
...
...
@@ -213,7 +213,7 @@ class AppChat extends Basic
$image
=
\think\Image
::
open
(
$static_path
);
$image
->
thumb
(
500
,
500
)
->
save
(
$static_path
);
//生成缩略图
$data
=
[
'
file_name'
=>
CHAT_IMG_URL
.
$img_path
,
'
name'
=>
$img_path
];
$data
=
[
'name'
=>
$img_path
];
}
else
{
// 上传失败获取错误信息
return
$this
->
response
(
"101"
,
$file
->
getError
());
...
...
application/chat/service/ChatService.php
View file @
d172700d
...
...
@@ -95,7 +95,7 @@ class ChatService
$where_
[
"id"
]
=
$userId
;
$agentsResult
=
$this
->
agentsModel
->
getAgentsById
(
"id"
,
$where_
);
if
(
$agentsResult
->
id
>
0
)
if
(
$agentsResult
[
0
][
'id'
]
>
0
)
$onlyId
=
self
::
SOURCE_TYPE_AGENT
.
$userId
;
break
;
case
2
:
...
...
@@ -187,45 +187,66 @@ class ChatService
*/
public
function
getUserInfo
(
$only_id
,
$phone
,
$type
)
{
$user_phone
=
$phone
;
$user_phone
=
$agent_phone
=
[];
if
(
$only_id
)
{
$where_
[
"only_id"
]
=
$only_id
;
$only_id_arr
=
explode
(
","
,
$only_id
);
$where_
[
"only_id"
]
=
array
(
"in"
,
$only_id_arr
);
$where_
[
"status"
]
=
0
;
$field
=
"type,user_id,phone,only_id"
;
$chat_user
=
$this
->
chatUserModel
->
getChatUser
(
$where_
,
$field
);
if
(
$chat_user
[
0
][
"phone"
])
{
$user_phone
=
$chat_user
[
0
][
"phone"
];
foreach
(
$chat_user
as
$v
)
{
if
(
$v
[
"type"
]
==
1
)
{
array_push
(
$agent_phone
,
$v
[
"phone"
]);
}
else
{
array_push
(
$user_phone
,
$v
[
"phone"
]);
}
}
}
else
{
if
(
$type
==
1
)
{
$agent_phone
=
[
$phone
];
}
else
if
(
$type
==
2
)
{
$user_phone
=
[
$phone
];
}
}
$info
=
[];
switch
(
$type
)
{
case
1
:
$field
=
"id,realname as user_nick,phone as user_phone,head_portrait as user_pic"
;
$where_agent
[
"phone"
]
=
$user_phone
;
$where_agent
[
"inuse"
]
=
1
;
$info_arr
=
[];
if
(
count
(
$agent_phone
)
>
0
)
{
$field
=
"id,realname as user_nick,phone as user_phone,head_portrait as user_pic"
;
$agentsResult
=
$this
->
agentsModel
->
getAgentsById
(
$field
,
$where_agent
);
$where_agent
[
"phone"
]
=
array
(
"in"
,
$agent_phone
);
$where_agent
[
"inuse"
]
=
1
;
if
(
$agentsResult
[
"user_pic"
])
{
$agentsResult
[
"user_pic"
]
=
IMG_PATH
.
$agentsResult
[
"user_pic"
];
$agentsResult
=
$this
->
agentsModel
->
getAgentsById
(
$field
,
$where_agent
);
foreach
(
$agentsResult
as
$v
)
{
if
(
$v
[
"user_pic"
])
{
$v
[
"user_pic"
]
=
IMG_PATH
.
$v
[
"user_pic"
];
}
$info
=
$agentsResult
;
break
;
case
2
:
$fields
=
"id,user_nick,user_phone,user_pic"
;
array_push
(
$info_arr
,
$v
);
}
$param
[
"status"
]
=
0
;
$param
[
"user_phone"
]
=
$user_phone
;
}
$userResult
=
$this
->
userModel
->
getUserByWhere
(
$param
,
$fields
);
if
(
$userResult
[
"user_pic"
])
{
$agentsResult
[
"user_pic"
]
=
HEADERIMGURL
.
$userResult
[
"user_pic"
];
if
(
count
(
$user_phone
)
>
0
)
{
$fields
=
"id,user_nick,user_phone,user_pic"
;
$param
[
"status"
]
=
0
;
$param
[
"user_phone"
]
=
array
(
"in"
,
$user_phone
);
$userResult
=
$this
->
userModel
->
getUserByWhere
(
$param
,
$fields
);
foreach
(
$userResult
as
$v
)
{
if
(
$v
[
"user_pic"
])
{
$v
[
"user_pic"
]
=
HEADERIMGURL
.
$v
[
"user_pic"
];
}
$info
=
$userResult
;
break
;
array_push
(
$info_arr
,
$v
)
;
}
}
return
$info
;
return
$info
_arr
;
}
...
...
application/chat/utils/curl_cookie.txt
View file @
d172700d
...
...
@@ -2,4 +2,4 @@
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
a1.easemob.com FALSE / FALSE 15168
69338
rememberMe deleteMe
a1.easemob.com FALSE / FALSE 15168
74980
rememberMe deleteMe
application/model/Users.php
View file @
d172700d
...
...
@@ -9,6 +9,12 @@ class Users extends Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_users'
;
protected
$usersModel
;
function
__construct
()
{
$this
->
usersModel
=
Db
(
$this
->
table
);
}
/**
* 查询用户
...
...
@@ -34,9 +40,10 @@ class Users extends Model
}
public
function
getUserByWhere
(
$param
,
$fields
=
'id,user_phone'
)
{
$data
=
$this
->
field
(
$fields
)
$data
=
$this
->
usersModel
->
field
(
$fields
)
->
where
(
$param
)
->
find
();
->
select
();
return
$data
;
}
/**
* 查询用户和经纪人
...
...
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