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
11b187e2
Commit
11b187e2
authored
Jul 12, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据格式修改
parent
000d2ed6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
+27
-19
GeTuiUtils.php
application/chat/utils/GeTuiUtils.php
+7
-12
RPush.php
application/chat/utils/RPush.php
+20
-7
No files found.
application/chat/utils/GeTuiUtils.php
View file @
11b187e2
...
@@ -37,21 +37,16 @@ class GeTuiUtils
...
@@ -37,21 +37,16 @@ class GeTuiUtils
* @param $data
* @param $data
* @return array
* @return array
*/
*/
public
function
pushMessageToIgt
(
$push_id
,
$type
=
'other'
,
$title
,
$payload
)
/**
* @param $push_id
* @param $title
* @param $payload
* @return array
*/
public
function
pushMessageToIgt
(
$push_id
,
$title
,
$payload
)
{
{
$igt
=
new
\IGeTui
(
self
::
IGT_HOST
,
self
::
IGT_APP_KEY
,
self
::
IGT_MASTER_SECRET
);
$igt
=
new
\IGeTui
(
self
::
IGT_HOST
,
self
::
IGT_APP_KEY
,
self
::
IGT_MASTER_SECRET
);
/* $payload['title'] = $title;
$payload['type'] = $type; //0系统,1用户消息
$payload['msg_content'] = $data['msg_content'];
$payload['to_id'] = $data['to_id']; //接收人
$payload['from_id'] = $data['from_id']; //发送人
$payload['to_name'] = $data['to_name'];//接收人名字
$payload['from_name'] = $data['from_name'];//发送人名字
$payload['target_type'] = $data['target_type']; //1文字,2.图片 3.楼盘*/
try
{
try
{
//模板
//模板
$template
=
$this
->
onlineAllTemplate
(
$payload
,
$title
,
"1231231"
);
$template
=
$this
->
onlineAllTemplate
(
$payload
,
$title
,
"1231231"
);
...
...
application/chat/utils/RPush.php
View file @
11b187e2
...
@@ -64,20 +64,33 @@ class RPush
...
@@ -64,20 +64,33 @@ class RPush
{
{
$title
=
"收到一条消息"
;
$title
=
"收到一条消息"
;
$arr
=
array
(
// $arr = array(
'target_type'
=>
$target_type
,
// 'target_type' => $target_type,
// 'target' => $target,
// 'msg' => [ "type" => "txt", "msg" => $msg_content ],
// 'from' => $from,
// 'ext' => [ "msg_type" => $type, "user_name" => $user_name ]
// );
$payload
=
json_encode
(
array
(
'title'
=>
$title
,
'content'
=>
$msg_content
,
'type'
=>
$target_type
,
'name'
=>
$title
,
'imageUrl'
=>
''
,
'target'
=>
$target
,
'target'
=>
$target
,
'msg'
=>
[
"type"
=>
"txt"
,
"msg"
=>
$msg_content
],
'from'
=>
$from
,
'from'
=>
$from
,
'ext'
=>
[
"msg_type"
=>
$type
,
"user_name"
=>
$user_name
]
'msg_type'
=>
1
,
// 1文本 2图片3楼盘
);
'ext'
=>
[
"user_name"
=>
$user_name
]
$data
=
json_encode
(
$arr
);
));
// $data = json_encode($arr);
$pushMessageToIgt
=
new
GeTuiUtils
();
$pushMessageToIgt
=
new
GeTuiUtils
();
$push_arr
=
$target
;
$push_arr
=
$target
;
$response
=
$pushMessageToIgt
->
pushMessageToIgt
(
$push_arr
,
$t
ype
=
'other'
,
$title
,
$data
);
$response
=
$pushMessageToIgt
->
pushMessageToIgt
(
$push_arr
,
$t
itle
,
$payload
);
/* $curl = new \app\chat\utils\CurlUtil();
/* $curl = new \app\chat\utils\CurlUtil();
$curl->headers = [
$curl->headers = [
"Accept" => "application/json",
"Accept" => "application/json",
...
...
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