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
b3b16dcd
Commit
b3b16dcd
authored
Jul 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user_id
parent
77a245c6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
ChatService.php
application/chat/service/ChatService.php
+7
-2
ChatUser.php
application/model/ChatUser.php
+25
-0
No files found.
application/chat/service/ChatService.php
View file @
b3b16dcd
...
@@ -210,8 +210,13 @@ class ChatService
...
@@ -210,8 +210,13 @@ class ChatService
$userExt
=
new
ChatUserExt
();
$userExt
=
new
ChatUserExt
();
$where
[
'only_id'
]
=
$target
;
$where
[
'only_id'
]
=
$target
;
$user_id
=
0
;
if
(
$is_user
)
{
if
(
$is_user
)
{
$m_user
=
new
ChatUser
();
$user_where
[
'only_id'
]
=
$from
;
$user_where
[
'status'
]
=
1
;
$user_arr
=
$m_user
->
getChatUserOne
(
'user_id'
,
$user_where
);
$user_id
=
empty
(
$user_arr
[
'user_id'
])
?
0
:
$user_arr
[
'user_id'
]
;
$where
[
'type'
]
=
2
;
$where
[
'type'
]
=
2
;
}
else
{
}
else
{
$where
[
'type'
]
=
1
;
$where
[
'type'
]
=
1
;
...
@@ -226,7 +231,7 @@ class ChatService
...
@@ -226,7 +231,7 @@ class ChatService
foreach
(
$info
as
$item
)
{
foreach
(
$info
as
$item
)
{
array_push
(
$push_id
,
$item
[
"push_id"
]);
array_push
(
$push_id
,
$item
[
"push_id"
]);
}
}
$rPush
->
send
(
$user_name
,
$target_type
,
$target
,
$msg_content
,
$from
,
$is_user
,
$type
,
$accessToken
,
[
$this
,
'saveSendStatus'
],
$push_id
,
$msg_id
,
$
info
[
0
][
'user_id'
]
);
$rPush
->
send
(
$user_name
,
$target_type
,
$target
,
$msg_content
,
$from
,
$is_user
,
$type
,
$accessToken
,
[
$this
,
'saveSendStatus'
],
$push_id
,
$msg_id
,
$
user_id
);
return
true
;
return
true
;
}
}
...
...
application/model/ChatUser.php
View file @
b3b16dcd
...
@@ -18,11 +18,21 @@ class ChatUser extends Model
...
@@ -18,11 +18,21 @@ class ChatUser extends Model
protected
$table
=
'chat_user'
;
protected
$table
=
'chat_user'
;
protected
$db
;
protected
$db
;
/**
* ChatUser constructor.
*/
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
db
=
Db
(
$this
->
table
);
$this
->
db
=
Db
(
$this
->
table
);
}
}
/**
* @param $params
* @param string $field
* @return mixed
* @throws \think\Exception
* @throws \think\exception\DbException
*/
public
function
getChatUser
(
$params
,
$field
=
"only_id,phone"
)
public
function
getChatUser
(
$params
,
$field
=
"only_id,phone"
)
{
{
$data
=
$this
->
db
->
field
(
$field
)
$data
=
$this
->
db
->
field
(
$field
)
...
@@ -44,4 +54,18 @@ class ChatUser extends Model
...
@@ -44,4 +54,18 @@ class ChatUser extends Model
return
$res
;
return
$res
;
}
}
/**
* @param $field
* @param $params
* @return mixed
* @throws \think\Exception
* @throws \think\exception\DbException
*/
public
function
getChatUserOne
(
$field
,
$params
)
{
$data
=
$this
->
db
->
field
(
$field
)
->
where
(
$params
)
->
find
();
return
$data
;
}
}
}
\ No newline at end of file
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