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
887ece58
Commit
887ece58
authored
Aug 28, 2021
by
mengweifu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature_mwf_azkaban
parents
a7d3fd75
8873d65c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
GoodsException.php
application/exception/custom/GoodsException.php
+2
-0
Marketingfororder.php
...ation/modules/Marketing/controllers/Marketingfororder.php
+1
-1
MarketingService.php
application/services/marketing/MarketingService.php
+4
-0
Pindan.php
daemon/Pindan.php
+18
-12
No files found.
application/exception/custom/GoodsException.php
View file @
887ece58
...
...
@@ -15,6 +15,7 @@ class GoodsException extends BaseException
const
EMPTY_OTA_ID
=
37
;
const
OTA_NOT_EXIST
=
38
;
const
RULE_LIMIT_ERROR
=
50
;
const
NOT_FIND_MARKETING
=
51
;
protected
$cus
=
[
0
=>
'商品创建失败,请稍后重试'
,
...
...
@@ -68,5 +69,6 @@ class GoodsException extends BaseException
48
=>
'请满足以下条件后提交,售价-分销总金额-手续费>=结算价'
,
49
=>
'库存不得小于已售库存'
,
self
::
RULE_LIMIT_ERROR
=>
'单人可买上限填写错误'
,
self
::
NOT_FIND_MARKETING
=>
'找不到活动'
,
];
}
\ No newline at end of file
application/modules/Marketing/controllers/Marketingfororder.php
View file @
887ece58
...
...
@@ -39,7 +39,7 @@ class MarketingfororderController extends Base
$addressList
=
[];
//
if
(
!
empty
(
$takePlaceList
))
$addressList
=
array_
unique
(
array_column
(
$takePlaceList
,
'address'
));
$addressList
=
array_
values
(
array_unique
(
array_column
(
$takePlaceList
,
'address'
)
));
//
$this
->
success
([
"result"
=>
[
'take_place_list'
=>
$takePlaceList
,
...
...
application/services/marketing/MarketingService.php
View file @
887ece58
...
...
@@ -922,6 +922,10 @@ class MarketingService
private
static
function
pindanMarketingInfo
(
$params
)
{
$marketingInfo
=
Marketing
::
getRecord
([
'marketing_id'
=>
$params
[
'marketing_id'
],
"marketing_type"
=>
Marketing
::
MARKETING_TYPE_PINDAN
]);
if
(
empty
(
$marketingInfo
))
throw
new
GoodsException
([
'cus'
=>
GoodsException
::
NOT_FIND_MARKETING
]);
$pindanMarketing
=
MarketingPindan
::
getRecord
([
'marketing_id'
=>
$params
[
'marketing_id'
]]);
$lifeAccountList
=
CommonService
::
getlifeAccountList
([
'life_account_id'
=>
[
$pindanMarketing
[
"publish_life_account_id"
]]]);
...
...
daemon/Pindan.php
View file @
887ece58
...
...
@@ -6,7 +6,7 @@ namespace Daemon;
use
Api\PhpServices\Daemon\DaemonServiceInterface
;
use
Api\PhpUtils\Log\DaemonLog
;
use
App\
Services\marketing\MarketingService
;
use
App\
Models\marketing\mysql\Marketing
;
use
Api\PhpServices\Wechat\Msg
;
class
Pindan
implements
DaemonServiceInterface
...
...
@@ -22,15 +22,21 @@ class Pindan implements DaemonServiceInterface
}
try
{
//查询进行中的拼单活动
$params
[
'marketing_type'
]
=
4
;
//1分销 2团购 3秒杀 4团餐
$params
[
'online_status'
]
=
1
;
//状态 , 1启用,2关闭,3 到期
$params
[
'activity_status'
]
=
2
;
//1 未开始,2进行中,3已结束
$params
[
'page'
]
=
1
;
$params
[
'page_size'
]
=
1
;
$list
=
MarketingService
::
marketingList
(
$params
);
//查询进行中的 今天开始的 拼单活动 --昨天16:40以后开始的活动 视为新上的活动
$lastStartTime
=
date
(
"Y-m-d 16:40:00"
,
strtotime
(
'-1 days'
));
$now
=
date
(
"Y-m-d H:i:00"
);
$where
[
'marketing_type'
]
=
4
;
$where
[
'online_status'
]
=
1
;
$where
[
"start_time[<=]"
]
=
$now
;
$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
(
'DaemonServiceInterface_pindan'
,
'no need to send at'
.
date
(
'Y-m-d H:i:s'
)
...
...
@@ -47,9 +53,9 @@ class Pindan implements DaemonServiceInterface
$type
=
2
;
// 1 公众号 2 小程序
//活动信息
$params
=
[
self
::
emojiFilter
(
$list
[
'result'
][
0
][
'marketing_name'
]),
$list
[
'result'
][
0
][
'create
_time'
],
$list
[
'result'
][
0
][
'pindan_desc'
]
?:
self
::
DEFAULT_DESC
self
::
emojiFilter
(
$list
[
0
][
'marketing_name'
]),
$list
[
0
][
'start
_time'
],
$list
[
0
][
'pindan_desc'
]
?:
self
::
DEFAULT_DESC
];
//发送消息
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