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
ff5b8018
Commit
ff5b8018
authored
Jan 20, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
7043b84a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
42 deletions
+70
-42
AppChat.php
application/chat/controller/AppChat.php
+15
-15
ChatService.php
application/chat/service/ChatService.php
+15
-14
RPush.php
application/chat/utils/RPush.php
+3
-1
curl_cookie.txt
application/chat/utils/curl_cookie.txt
+1
-1
AttentionModel.php
application/model/AttentionModel.php
+6
-6
ChatMsg.php
application/model/ChatMsg.php
+1
-1
ChatMsgExt.php
application/model/ChatMsgExt.php
+3
-4
log.txt
log.txt
+26
-0
No files found.
application/chat/controller/AppChat.php
View file @
ff5b8018
...
@@ -111,21 +111,21 @@ class AppChat extends Basic
...
@@ -111,21 +111,21 @@ class AppChat extends Basic
public
function
pushMsg
()
public
function
pushMsg
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'target'
])
||
!
isset
(
$params
[
'type'
])
||
!
isset
(
$params
[
'msg_content'
])
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'target'
])
||
!
isset
(
$params
[
'type'
])
||
!
isset
(
$params
[
'msg_content'
])
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'is_user'
])
||
!
isset
(
$params
[
'from'
]))
{
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'is_user'
])
||
!
isset
(
$params
[
'from'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
}
/*$params = array(
/*
$params = array(
'msg_content' => '111',
'msg_content' => '111',
'target_type' => 'users',
'target_type' => 'users',
'source' => '1',
'source' => '1',
'from' => 'app_64',
'from' => 'app_64',
'type' => '1',
'type' => '1',
'is_user' => '0',
'is_user' => '0',
'target' => '18112347151',
'target' => '18112347151',
);*/
);*/
$target_type
=
$params
[
'target_type'
];
// 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
$target_type
=
$params
[
'target_type'
];
// 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
$target
=
$params
[
'target'
];
//接受人 if target_type 群 者表示群id
$target
=
$params
[
'target'
];
//接受人 if target_type 群 者表示群id
$source
=
$params
[
'source'
];
//消息来源 1c端app 2b端app 3其他
$source
=
$params
[
'source'
];
//消息来源 1c端app 2b端app 3其他
...
...
application/chat/service/ChatService.php
View file @
ff5b8018
...
@@ -99,7 +99,7 @@ class ChatService
...
@@ -99,7 +99,7 @@ class ChatService
$userResult
=
$this
->
userModel
->
selectUser
(
$userId
);
$userResult
=
$this
->
userModel
->
selectUser
(
$userId
);
if
(
$userResult
->
id
)
if
(
$userResult
->
id
)
$onlyId
=
self
::
SOURCE_TYPE_APP
.
$user
I
d
;
$onlyId
=
self
::
SOURCE_TYPE_APP
.
$user
Result
->
i
d
;
break
;
break
;
}
}
if
(
!
$onlyId
)
{
if
(
!
$onlyId
)
{
...
@@ -143,7 +143,7 @@ class ChatService
...
@@ -143,7 +143,7 @@ class ChatService
$rPush
=
new
RPush
();
$rPush
=
new
RPush
();
//todo 消息接收人必须是数据
//todo 消息接收人必须是数据
$rPush
->
send
(
$target_type
,
[
$target
],
$type
,
$msg_content
,
$from
,
$accessToken
,
[
$this
,
'saveSendStatus'
]);
//
$rPush->send($target_type, [$target], $type, $msg_content, $from, $accessToken, [ $this, 'saveSendStatus' ]);
//返回消息发送成功
//返回消息发送成功
return
true
;
return
true
;
}
}
...
@@ -157,10 +157,10 @@ class ChatService
...
@@ -157,10 +157,10 @@ class ChatService
*/
*/
public
function
saveSendStatus
(
$response
,
$target
,
$sender
,
$msg_content
)
public
function
saveSendStatus
(
$response
,
$target
,
$sender
,
$msg_content
)
{
{
/* $response = json_decode($response, true);
/* $response = json_decode($response, true);
$response['time'] = date('Y-m-d H:i:s');
$response['time'] = date('Y-m-d H:i:s');
$status = $response['statusCode'] == RPush::PUSH_STATUS_SUCCESS ? MsgStatus::STATUS_SUCCESS : MsgStatus::STATUS_FAILURE;
$status = $response['statusCode'] == RPush::PUSH_STATUS_SUCCESS ? MsgStatus::STATUS_SUCCESS : MsgStatus::STATUS_FAILURE;
$this->insertPushLog($sender, $target, $msg_content, $status, $response['statusMsg']);*/
$this->insertPushLog($sender, $target, $msg_content, $status, $response['statusMsg']);*/
}
}
/**
/**
...
@@ -188,6 +188,7 @@ class ChatService
...
@@ -188,6 +188,7 @@ class ChatService
$msgModel
=
new
ChatMsg
();
$msgModel
=
new
ChatMsg
();
$id
=
$msgModel
->
addChatMsg
(
$params
);
$id
=
$msgModel
->
addChatMsg
(
$params
);
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
//todo 插入msg_ext
//todo 插入msg_ext
$group_id
=
0
;
$group_id
=
0
;
...
@@ -208,16 +209,16 @@ class ChatService
...
@@ -208,16 +209,16 @@ class ChatService
*/
*/
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
{
{
$param
s
[
"msg_id"
]
=
$id
;
$param
[
"msg_id"
]
=
$id
;
$param
s
[
"type"
]
=
$type
;
$param
[
"type"
]
=
$type
;
$param
s
[
"body"
]
=
$msg_content
;
$param
[
"body"
]
=
$msg_content
;
$param
s
[
"send_type"
]
=
$is_group
;
$param
[
"send_type"
]
=
$is_group
;
$param
s
[
"group_id"
]
=
$group_id
;
$param
[
"group_id"
]
=
$group_id
;
$param
s
[
"create_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"create_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
s
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
->
addChatMsgExt
(
$param
s
);
$msgExtModel
->
addChatMsgExt
(
$param
);
}
}
/** 获取聊天记录
/** 获取聊天记录
...
...
application/chat/utils/RPush.php
View file @
ff5b8018
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\chat\utils
;
namespace
app\chat\utils
;
use
app\chat\consts\ConfigConst
;
use
app\chat\consts\ConfigConst
;
use
Think\Log
;
/**
/**
...
@@ -53,6 +54,7 @@ class RPush
...
@@ -53,6 +54,7 @@ class RPush
'from'
=>
$from
,
'from'
=>
$from
,
);
);
$data
=
json_encode
(
$arr
);
$data
=
json_encode
(
$arr
);
echo
$data
;
echo
"-------------"
;
$curl
=
new
\app\chat\utils\CurlUtil
();
$curl
=
new
\app\chat\utils\CurlUtil
();
$curl
->
headers
=
[
$curl
->
headers
=
[
"Accept"
=>
"application/json"
,
"Accept"
=>
"application/json"
,
...
@@ -65,7 +67,7 @@ class RPush
...
@@ -65,7 +67,7 @@ class RPush
];
];
$url
=
$this
->
buildSendUrl
();
$url
=
$this
->
buildSendUrl
();
$response
=
$curl
->
post
(
$url
,
$data
);
$response
=
$curl
->
post
(
$url
,
$data
);
dump
(
$response
);
Log
::
record
(
'info -------------'
,
json_encode
(
$response
)
);
return
$response
;
return
$response
;
}
}
...
...
application/chat/utils/curl_cookie.txt
View file @
ff5b8018
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
# http://curl.haxx.se/docs/http-cookies.html
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
# This file was generated by libcurl! Edit at your own risk.
a1.easemob.com FALSE / FALSE 151641
6547
rememberMe deleteMe
a1.easemob.com FALSE / FALSE 151641
9232
rememberMe deleteMe
application/model/AttentionModel.php
View file @
ff5b8018
...
@@ -40,22 +40,22 @@ class AttentionModel extends Model
...
@@ -40,22 +40,22 @@ class AttentionModel extends Model
->
select
();
->
select
();
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$saveWhere
[
"id"
]
=
$params
[
"id"
];
$saveWhere
[
"id"
]
=
$params
[
"id"
];
$arr
[
"is_del"
]
=
1
;
$arr
[
"is_del"
]
=
1
;
}
else
{
}
else
{
return
[
"code"
=>
"101"
,
"msg"
=>
"数据不存在"
];
return
[
"code"
=>
"101"
,
"msg"
=>
"数据不存在"
];
}
}
}
else
{
//关注
}
else
{
//关注
//保存的时候可能是上次取消关注过的所以改遍状态就行了
//保存的时候可能是上次取消关注过的所以改遍状态就行了
$where_
[
"user_id"
]
=
$params
[
'user_id'
];
$where_
[
"user_id"
]
=
$params
[
'user_id'
];
$where_
[
"house_id"
]
=
$params
[
'house_id'
];
$where_
[
"house_id"
]
=
$params
[
'house_id'
];
$res
=
$this
$res
=
$this
->
where
(
$where_
)
->
where
(
$where_
)
->
select
();
->
select
();
if
(
count
(
$res
)
>
0
)
{
if
(
count
(
$res
)
>
0
)
{
$saveWhere
[
"id"
]
=
$res
[
0
][
"id"
];
$saveWhere
[
"id"
]
=
$res
[
0
][
"id"
];
$arr
[
"is_del"
]
=
0
;
$arr
[
"is_del"
]
=
0
;
$id
=
$res
[
0
][
"id"
];
$id
=
$res
[
0
][
"id"
];
}
else
{
}
else
{
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
...
@@ -90,7 +90,7 @@ class AttentionModel extends Model
...
@@ -90,7 +90,7 @@ class AttentionModel extends Model
public
function
myAttentionList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$param
)
public
function
myAttentionList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$param
)
{
{
$params
[
"a.user_id"
]
=
$param
[
"user_id"
];
$params
[
"a.user_id"
]
=
$param
[
"user_id"
];
$params
[
"a.is_del"
]
=
$param
[
"is_del"
];
$params
[
"a.is_del"
]
=
$param
[
"is_del"
];
//$params["b.room_num_left"] = array( "<>", 0 ); //剩余数为0 的商品不显示
//$params["b.room_num_left"] = array( "<>", 0 ); //剩余数为0 的商品不显示
$params
[
"b.show_all"
]
=
array
(
"eq"
,
0
);
//只显示公开的楼盘
$params
[
"b.show_all"
]
=
array
(
"eq"
,
0
);
//只显示公开的楼盘
return
$this
->
field
(
$field
)
return
$this
->
field
(
$field
)
...
...
application/model/ChatMsg.php
View file @
ff5b8018
...
@@ -29,8 +29,8 @@ class ChatMsg extends Model
...
@@ -29,8 +29,8 @@ class ChatMsg extends Model
try
{
try
{
$this
->
save
(
$params
);
$this
->
save
(
$params
);
$id
=
$this
->
id
;
$id
=
$this
->
id
;
return
$id
;
Db
::
commit
();
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
Db
::
rollback
();
...
...
application/model/ChatMsgExt.php
View file @
ff5b8018
...
@@ -20,18 +20,17 @@ class ChatMsgExt extends Model
...
@@ -20,18 +20,17 @@ class ChatMsgExt extends Model
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
db
=
Db
(
$this
->
table
);
$this
->
db
=
Db
::
name
(
$this
->
table
);
}
}
public
function
addChatMsgExt
(
$params
)
public
function
addChatMsgExt
(
$params
)
{
{
Db
::
startTrans
();
Db
::
startTrans
();
try
{
try
{
$this
->
save
(
$params
);
$this
->
db
->
insert
(
$params
);
$id
=
$this
->
id
;
return
$id
;
Db
::
commit
();
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
dump
(
$e
);
Db
::
rollback
();
Db
::
rollback
();
}
}
...
...
log.txt
View file @
ff5b8018
...
@@ -258,3 +258,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
@@ -258,3 +258,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusMsg>IP鉴权失败</statusMsg>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
</Response>
request body = <TemplateSMS>
<to>18756256666</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>3450</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=40EE1C43A1B08B698B610DC95026AF74
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18756255555</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>5919</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=8DABD7C3A3D79365F4AA65E92613F6A1
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
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