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
12addacd
Commit
12addacd
authored
Jul 18, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return id
parent
31906b5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
ChatService.php
application/chat/service/ChatService.php
+6
-3
ChatMsgExt.php
application/model/ChatMsgExt.php
+2
-2
No files found.
application/chat/service/ChatService.php
View file @
12addacd
...
...
@@ -202,7 +202,7 @@ class ChatService
// 判断是否创建关系没有则保存
$this
->
verifyRelation
(
$target
,
$from
);
$this
->
insertMsg
(
$target_type
,
$target
,
$source
,
$is_user
,
$type
,
$msg_content
,
$from
);
$
msg_id
=
$
this
->
insertMsg
(
$target_type
,
$target
,
$source
,
$is_user
,
$type
,
$msg_content
,
$from
);
$rPush
=
new
RPush
();
// 消息接收人必须是数组
...
...
@@ -336,6 +336,7 @@ class ChatService
* @param $type
* @param $msg_content
* @param $from
* @return int|string
*/
private
function
insertMsg
(
$target_type
,
$target
,
$source
,
$is_user
,
$type
,
$msg_content
,
$from
)
{
...
...
@@ -359,7 +360,7 @@ class ChatService
if
(
$target_type
!=
"users"
)
{
$group_id
=
$from
;
}
$this
->
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$params
[
"is_group"
],
$group_id
);
return
$this
->
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$params
[
"is_group"
],
$group_id
);
}
}
...
...
@@ -477,6 +478,7 @@ class ChatService
return
$result
;
}
/**
* 记录消息body
* @param $id
...
...
@@ -484,6 +486,7 @@ class ChatService
* @param $msg_content
* @param $is_group
* @param $group_id
* @return int|string
*/
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
{
...
...
@@ -496,7 +499,7 @@ class ChatService
$param
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
->
addChatMsgExt
(
$param
);
return
$msgExtModel
->
addChatMsgExt
(
$param
);
}
...
...
application/model/ChatMsgExt.php
View file @
12addacd
...
...
@@ -27,10 +27,10 @@ class ChatMsgExt extends Model
{
Db
::
startTrans
();
try
{
$
this
->
db
->
insert
(
$params
);
$
id
=
$this
->
db
->
insertGetId
(
$params
);
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
dump
(
$e
);
Db
::
rollback
();
}
...
...
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