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
2a735214
Commit
2a735214
authored
Aug 27, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 只在当天有活动开始时调用发消息接口
parent
d2e8b59e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
Pindan.php
daemon/Pindan.php
+18
-12
No files found.
daemon/Pindan.php
View file @
2a735214
...
@@ -6,7 +6,7 @@ namespace Daemon;
...
@@ -6,7 +6,7 @@ namespace Daemon;
use
Api\PhpServices\Daemon\DaemonServiceInterface
;
use
Api\PhpServices\Daemon\DaemonServiceInterface
;
use
Api\PhpUtils\Log\DaemonLog
;
use
Api\PhpUtils\Log\DaemonLog
;
use
App\
Services\marketing\MarketingService
;
use
App\
Models\marketing\mysql\Marketing
;
use
Api\PhpServices\Wechat\Msg
;
use
Api\PhpServices\Wechat\Msg
;
class
Pindan
implements
DaemonServiceInterface
class
Pindan
implements
DaemonServiceInterface
...
@@ -22,15 +22,21 @@ class Pindan implements DaemonServiceInterface
...
@@ -22,15 +22,21 @@ class Pindan implements DaemonServiceInterface
}
}
try
{
try
{
//查询进行中的拼单活动
//查询进行中的 今天开始的 拼单活动 --昨天16:40以后开始的活动 视为新上的活动
$params
[
'marketing_type'
]
=
4
;
//1分销 2团购 3秒杀 4团餐
$lastStartTime
=
date
(
"Y-m-d 16:40:00"
,
strtotime
(
'-1 days'
));
$params
[
'online_status'
]
=
1
;
//状态 , 1启用,2关闭,3 到期
$now
=
date
(
"Y-m-d H:i:00"
);
$params
[
'activity_status'
]
=
2
;
//1 未开始,2进行中,3已结束
$where
[
'marketing_type'
]
=
4
;
$params
[
'page'
]
=
1
;
$where
[
'online_status'
]
=
1
;
$params
[
'page_size'
]
=
1
;
$where
[
"start_time[<=]"
]
=
$now
;
$list
=
MarketingService
::
marketingList
(
$params
);
$where
[
"start_time[>]"
]
=
$lastStartTime
;
$where
[
"end_time[>=]"
]
=
$now
;
$where
[
'ORDER'
]
=
[
"update_time"
=>
"DESC"
];
$where
[
'LIMIT'
]
=
[
0
,
1
];
$list
=
Marketing
::
select
([
"marketing_id"
,
"marketing_name"
,
"marketing_type"
,
"start_time"
,
"end_time"
,
"online_status"
,
"update_time"
,
"create_time"
]
,
$where
);
if
(
empty
(
$list
[
'result'
]
))
{
if
(
empty
(
$list
))
{
DaemonLog
::
info
(
DaemonLog
::
info
(
'DaemonServiceInterface_pindan'
,
'DaemonServiceInterface_pindan'
,
'no need to send at'
.
date
(
'Y-m-d H:i:s'
)
'no need to send at'
.
date
(
'Y-m-d H:i:s'
)
...
@@ -47,9 +53,9 @@ class Pindan implements DaemonServiceInterface
...
@@ -47,9 +53,9 @@ class Pindan implements DaemonServiceInterface
$type
=
2
;
// 1 公众号 2 小程序
$type
=
2
;
// 1 公众号 2 小程序
//活动信息
//活动信息
$params
=
[
$params
=
[
self
::
emojiFilter
(
$list
[
'result'
][
0
][
'marketing_name'
]),
self
::
emojiFilter
(
$list
[
0
][
'marketing_name'
]),
$list
[
'result'
][
0
][
'create
_time'
],
$list
[
0
][
'start
_time'
],
$list
[
'result'
][
0
][
'pindan_desc'
]
?:
self
::
DEFAULT_DESC
$list
[
0
][
'pindan_desc'
]
?:
self
::
DEFAULT_DESC
];
];
//发送消息
//发送消息
DaemonLog
::
info
(
DaemonLog
::
info
(
...
...
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