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
f10de4cc
Commit
f10de4cc
authored
Sep 01, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' into develop
# Conflicts: # application/services/marketing/MarketingService.php
parents
21868e23
9f9f48ab
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
13 deletions
+62
-13
MarketingPindan.php
application/models/marketing/mysql/MarketingPindan.php
+1
-0
TakePlace.php
application/models/marketing/mysql/TakePlace.php
+4
-0
Colonelorder.php
application/modules/Cli/controllers/Colonelorder.php
+16
-13
Colonelwallet.php
application/modules/Cli/controllers/Colonelwallet.php
+4
-0
ColonelOrder.php
application/modules/Job/controllers/ColonelOrder.php
+16
-0
ColonelWallet.php
application/modules/Job/controllers/ColonelWallet.php
+16
-0
run-colonel-order.job
deploy/job/run-colonel-order.job
+2
-0
run-colonel-wallet.job
deploy/job/run-colonel-wallet.job
+3
-0
No files found.
application/models/marketing/mysql/MarketingPindan.php
View file @
f10de4cc
...
...
@@ -13,6 +13,7 @@ class MarketingPindan extends MysqlBase
const
ACTIVITY_STATUS_NO_START
=
1
;
const
ACTIVITY_STATUS_IN_PROGRESS
=
2
;
const
ACTIVITY_STATUS_FINISHED
=
3
;
const
ACTIVITY_STATUS_START_TODAY
=
4
;
//今日上新
public
static
function
getRecord
(
$where
,
$colums
=
[])
{
...
...
application/models/marketing/mysql/TakePlace.php
View file @
f10de4cc
...
...
@@ -29,7 +29,11 @@ class TakePlace extends MysqlBase
$keywords
=
$params
[
'keywords'
]
??
''
;
$offset
=
$params
[
'offset'
]
??
0
;
$limit
=
$params
[
'limit'
]
??
20
;
$takePlaceIds
=
$params
[
'take_place_id'
]
??
[];
if
(
!
empty
(
$takePlaceIds
))
{
$where
[
'take_place_id'
]
=
$takePlaceIds
;
}
if
(
$lifeAccountId
)
{
$where
[
'life_account_id'
]
=
$lifeAccountId
;
}
...
...
application/modules/Cli/controllers/Colonelorder.php
View file @
f10de4cc
...
...
@@ -36,21 +36,23 @@ class ColonelorderController extends Cli
public
function
indexAction
()
{
FileLog
::
info
(
"colonel_distributor_order"
,
'团长分销-计算奖励脚本:start'
);
$userIdList
=
$this
->
getColonelUserIds
();
if
(
empty
(
$userIdList
)
||
empty
(
$this
->
colonelConfigList
))
{
return
true
;
}
$userIdList
=
array_chunk
(
$userIdList
,
self
::
DEFAULT_USER_BATCH_SIZE
);
$colonelPayInfoData
=
[];
foreach
(
$userIdList
as
$userIds
)
{
$batchPayInfoData
=
[]
;
// 完成目标单数
$batchPayInfoData
[]
=
$this
->
getInviteOrd
erData
(
$userIds
);
// 邀请新用户奖励
$batchPayInfoData
[]
=
$this
->
getInviteNewUserData
(
$userIds
);
$
colonelPayInfoData
=
array_merge
(
$colonelPayInfoData
,
$batch
PayInfoData
);
if
(
!
empty
(
$userIdList
)
&&
!
empty
(
$this
->
colonelConfigList
))
{
$userIdList
=
array_chunk
(
$userIdList
,
self
::
DEFAULT_USER_BATCH_SIZE
)
;
$colonelPayInfoData
=
[];
foreach
(
$userIdList
as
$userIds
)
{
$batchPayInfoData
=
[];
// 完成目标单数
$batchPayInfoData
[]
=
$this
->
getInviteOrderData
(
$userIds
)
;
// 邀请新用户奖励
$batchPayInfoData
[]
=
$this
->
getInviteNewUs
erData
(
$userIds
);
$colonelPayInfoData
=
array_merge
(
$colonelPayInfoData
,
$batchPayInfoData
);
}
$
this
->
handleSavePayInfo
(
$colonel
PayInfoData
);
}
return
$this
->
handleSavePayInfo
(
$colonelPayInfoData
);
FileLog
::
info
(
"colonel_distributor_order"
,
'团长分销-计算奖励脚本:end'
);
echo
"success"
;
}
/**
...
...
@@ -60,6 +62,7 @@ class ColonelorderController extends Cli
*/
public
function
handleSavePayInfo
(
$colonelPayInfoData
)
{
FileLog
::
info
(
"colonel_distributor_order"
,
'团长分销-计算奖励脚本:colonelPayInfoCount='
.
count
(
$colonelPayInfoData
));
if
(
!
empty
(
$colonelPayInfoData
))
{
$data
=
$this
->
addIdgenId
(
$colonelPayInfoData
);
try
{
...
...
application/modules/Cli/controllers/Colonelwallet.php
View file @
f10de4cc
...
...
@@ -13,8 +13,10 @@ class ColonelwalletController extends Cli
{
public
function
indexAction
()
{
FileLog
::
info
(
"colonel_distributor_wallet"
,
'团长分销-奖励钱包脚本:start'
);
$yesterday
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$payInfoList
=
$this
->
getPayInfo
(
$yesterday
);
FileLog
::
info
(
"colonel_distributor_wallet"
,
'团长分销-奖励钱包脚本:payInfoCount='
.
count
(
$payInfoList
));
if
(
!
empty
(
$payInfoList
))
{
if
(
$this
->
toWallet
(
$payInfoList
))
{
if
(
$this
->
deductingInventory
(
$payInfoList
))
{
...
...
@@ -22,6 +24,8 @@ class ColonelwalletController extends Cli
}
}
}
FileLog
::
info
(
"colonel_distributor_wallet"
,
'团长分销-奖励钱包脚本:end'
);
echo
"success"
;
}
/**
...
...
application/modules/Job/controllers/ColonelOrder.php
0 → 100644
View file @
f10de4cc
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 1:36 下午
*/
use
App\Base\Job
;
class
ColonelOrderController
extends
Job
{
public
function
indexAction
()
{
\Yaf\Application
::
app
()
->
bootstrap
()
->
getDispatcher
()
->
dispatch
(
new
\Yaf\Request\Simple
(
''
,
'cli'
,
'colonelorder'
,
'index'
,
[]));
}
}
\ No newline at end of file
application/modules/Job/controllers/ColonelWallet.php
0 → 100644
View file @
f10de4cc
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 2:28 下午
*/
use
App\Base\Job
;
class
ColonelWalletController
extends
Job
{
public
function
indexAction
()
{
\Yaf\Application
::
app
()
->
bootstrap
()
->
getDispatcher
()
->
dispatch
(
new
\Yaf\Request\Simple
(
''
,
'cli'
,
'colonelwallet'
,
'index'
,
[]));
}
}
\ No newline at end of file
deploy/job/run-colonel-order.job
0 → 100644
View file @
f10de4cc
type=command
command=bash docker run --rm -e LANG=en_US.UTF-8 -e TZ=Asia/Shanghai --net=bridge -h "`hostname`" --cap-add SYS_PTRACE --privileged docker2.yidian.com:5000/publish/bp-goods-azkaban-test-10-image /bin/bash -c "cd /home/services && sh start_job.sh test ColonelOrder index a=3&b=4"
\ No newline at end of file
deploy/job/run-colonel-wallet.job
0 → 100644
View file @
f10de4cc
type=command
command=bash docker run --rm -e LANG=en_US.UTF-8 -e TZ=Asia/Shanghai --net=bridge -h "`hostname`" --cap-add SYS_PTRACE --privileged docker2.yidian.com:5000/publish/bp-goods-azkaban-test-10-image /bin/bash -c "cd /home/services && sh start_job.sh test ColonelWallet index a=3&b=4"
dependencies=run-colonel-order
\ 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