Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
dc941fab
Commit
dc941fab
authored
Oct 10, 2019
by
xmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:公众号通知跳转url
parent
238ce7e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
45 deletions
+54
-45
src/Notice/Extensions/Notice/MpSender.php
+54
-45
No files found.
src/Notice/Extensions/Notice/MpSender.php
View file @
dc941fab
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
* Date: 2018/10/9
* Date: 2018/10/9
* Time: 10:50
* Time: 10:50
*/
*/
namespace
Hdll\Services\Notice\Extensions\Notice
;
namespace
Hdll\Services\Notice\Extensions\Notice
;
use
Hdll\Services\Notice\Common\WxMiniNotice
;
use
Hdll\Services\Notice\Common\WxMiniNotice
;
...
@@ -12,51 +13,58 @@ use Hdll\Services\Notice\Enum\NoticeEnum;
...
@@ -12,51 +13,58 @@ use Hdll\Services\Notice\Enum\NoticeEnum;
class
MpSender
implements
SenderInterface
class
MpSender
implements
SenderInterface
{
{
private
$sendType
=
NoticeEnum
::
TYPE_MP_SEND
;
private
$sendType
=
NoticeEnum
::
TYPE_MP_SEND
;
private
$data
;
private
$data
;
private
$unionId
;
private
$unionId
;
private
$miniprogram
;
private
$miniprogram
;
private
$sendData
;
private
$sendData
;
private
$template
;
private
$template
;
public
function
__construct
(
string
$unionId
,
array
$miniprogram
,
array
$sendData
,
string
$template
)
public
function
__construct
(
string
$unionId
,
array
$miniprogram
,
array
$sendData
,
string
$template
)
{
{
$this
->
unionId
=
$unionId
;
$this
->
unionId
=
$unionId
;
$this
->
miniprogram
=
$miniprogram
;
$this
->
miniprogram
=
$miniprogram
;
$this
->
sendData
=
$sendData
;
$this
->
sendData
=
$sendData
;
$this
->
template
=
$template
;
$this
->
template
=
$template
;
}
}
public
function
format
()
public
function
format
()
{
{
$this
->
data
[
$this
->
sendType
]
=
[
$this
->
data
[
$this
->
sendType
]
=
[
'unionId'
=>
$this
->
unionId
,
'unionId'
=>
$this
->
unionId
,
'template_id'
=>
$this
->
template
,
'template_id'
=>
$this
->
template
,
'miniprogram'
=>
[
'miniprogram'
=>
[
'appid'
=>
$this
->
miniprogram
[
'appId'
],
//小程序appid
'appid'
=>
$this
->
miniprogram
[
'appId'
],
//小程序appid
'pagepath'
=>
WxMiniNotice
::
generatePage
(
],
$this
->
miniprogram
[
'page'
],
'data'
=>
$this
->
sendData
$this
->
miniprogram
[
'param'
]
];
)
//小程序页面
//小程序跳转(优先)
],
if
(
isset
(
$this
->
miniprogram
[
'page'
]))
{
'data'
=>
$this
->
sendData
$this
->
data
[
$this
->
sendType
][
'pagepath'
]
=
WxMiniNotice
::
generatePage
(
];
$this
->
miniprogram
[
'page'
],
}
$this
->
miniprogram
[
'param'
]
);
public
function
getData
()
}
{
//url跳转
return
$this
->
data
===
null
?
[]
:
$this
->
data
;
if
(
isset
(
$this
->
miniprogram
[
'url'
]))
{
}
$this
->
data
[
$this
->
sendType
][
'url'
]
=
$this
->
miniprogram
[
'url'
];
}
public
function
getSendType
()
}
{
return
[
$this
->
sendType
];
public
function
getData
()
}
{
return
$this
->
data
===
null
?
[]
:
$this
->
data
;
}
public
function
getSendType
()
{
return
[
$this
->
sendType
];
}
}
}
\ 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