Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
9285b85a
Commit
9285b85a
authored
Aug 10, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 发送订阅通知消息格式修改
parent
80cad87e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
Pindan.php
daemon/Pindan.php
+15
-3
No files found.
daemon/Pindan.php
View file @
9285b85a
...
@@ -11,7 +11,8 @@ use Api\PhpServices\Wechat\Msg;
...
@@ -11,7 +11,8 @@ use Api\PhpServices\Wechat\Msg;
class
Pindan
implements
DaemonServiceInterface
class
Pindan
implements
DaemonServiceInterface
{
{
const
DEFAULT_DESC
=
'9.9元吃午餐开始预定啦,戳这里点餐吧'
;
public
function
run
()
public
function
run
()
{
{
//只在16:40执行逻辑
//只在16:40执行逻辑
...
@@ -41,9 +42,9 @@ class Pindan implements DaemonServiceInterface
...
@@ -41,9 +42,9 @@ class Pindan implements DaemonServiceInterface
$type
=
2
;
// 1 公众号 2 小程序
$type
=
2
;
// 1 公众号 2 小程序
//活动信息
//活动信息
$params
=
[
$params
=
[
$list
[
'result'
][
0
][
'marketing_name'
]
,
self
::
emojiFilter
(
$list
[
'result'
][
0
][
'marketing_name'
])
,
$list
[
'result'
][
0
][
'create_time'
],
$list
[
'result'
][
0
][
'create_time'
],
$list
[
'result'
][
0
][
'pindan_desc'
]
$list
[
'result'
][
0
][
'pindan_desc'
]
?:
self
::
DEFAULT_DESC
];
];
//发送消息
//发送消息
Msg
::
send
(
999
,
$app_id
,
$template_id
,
$page_url
,
$type
,
$params
);
Msg
::
send
(
999
,
$app_id
,
$template_id
,
$page_url
,
$type
,
$params
);
...
@@ -60,5 +61,16 @@ class Pindan implements DaemonServiceInterface
...
@@ -60,5 +61,16 @@ class Pindan implements DaemonServiceInterface
}
}
}
}
/**
* 过滤emoji表情
* @param string $str
* @return string
*/
private
function
emojiFilter
(
$str
)
{
$str
=
preg_replace_callback
(
'/./u'
,
function
(
array
$match
){
return
strlen
(
$match
[
0
])
>=
4
?
''
:
$match
[
0
];
},
$str
);
return
$str
;
}
}
}
\ 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