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
6ffb21b8
Commit
6ffb21b8
authored
Nov 30, 2021
by
顾文旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Job 定时任务
parent
92c44150
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
+24
-22
Colonelorder.php
application/modules/Job/controllers/Colonelorder.php
+22
-21
Colonelwallet.php
application/modules/Job/controllers/Colonelwallet.php
+2
-1
No files found.
application/modules/Job/controllers/Colonelorder.php
View file @
6ffb21b8
...
...
@@ -5,6 +5,7 @@
* Date: 2021/9/3 2:23 下午
*/
use
App\Base\Base
;
use
App\Base\Job
;
use
Api\PhpServices\Idgen\Idgen
;
use
App\Models\marketing\mysql\ColonelDistributorColonel
;
...
...
@@ -19,7 +20,7 @@ use App\Services\marketing\PindanActivityColonelConfigService;
use
Api\PhpUtils\Log\JobLog
;
use
App\Services\marketing\ColonelService
;
class
ColonelorderController
extends
Job
class
ColonelorderController
extends
Base
{
const
REWARD_UNIT
=
100
;
// 奖励单位: 分
const
INVITE_NEW_USER_REWARD
=
3
*
self
::
REWARD_UNIT
;
// 邀请新用户奖励
...
...
@@ -111,13 +112,13 @@ class ColonelorderController extends Job
$userNickList
=
$this
->
getUserList
(
array_column
(
$inviteNewUserList
,
'user_id'
));
foreach
(
$inviteNewUserList
as
$newUser
)
{
$colonelPayInfoData
[]
=
[
'date'
=>
$this
->
settlementDate
,
'type'
=>
ColonelDistributorPayInfo
::
TYPE_NEW_USER
,
'reward'
=>
self
::
INVITE_NEW_USER_REWARD
,
'finish_num'
=>
1
,
'invite_user_id'
=>
$newUser
[
'user_id'
],
'date'
=>
$this
->
settlementDate
,
'type'
=>
ColonelDistributorPayInfo
::
TYPE_NEW_USER
,
'reward'
=>
self
::
INVITE_NEW_USER_REWARD
,
'finish_num'
=>
1
,
'invite_user_id'
=>
$newUser
[
'user_id'
],
'invite_user_nick'
=>
empty
(
$userNickList
[
$newUser
[
'user_id'
]][
'user_nick'
])
?
''
:
$userNickList
[
$newUser
[
'user_id'
]][
'user_nick'
],
'colonel_user_id'
=>
$newUser
[
'inviter_user_id'
],
'colonel_user_id'
=>
$newUser
[
'inviter_user_id'
],
];
}
}
...
...
@@ -138,13 +139,13 @@ class ColonelorderController extends Job
foreach
(
$this
->
colonelConfigList
as
$config
)
{
if
(
$orderNum
[
'num'
]
>=
$config
[
'assess_order_num'
])
{
$colonelPayInfoData
[]
=
[
'date'
=>
$this
->
settlementDate
,
'type'
=>
ColonelDistributorPayInfo
::
TYPE_FINISH_TARGET
,
'reward'
=>
$config
[
'reward_amount'
]
*
self
::
REWARD_UNIT
,
'finish_num'
=>
$config
[
'assess_order_num'
],
'invite_user_id'
=>
0
,
'date'
=>
$this
->
settlementDate
,
'type'
=>
ColonelDistributorPayInfo
::
TYPE_FINISH_TARGET
,
'reward'
=>
$config
[
'reward_amount'
]
*
self
::
REWARD_UNIT
,
'finish_num'
=>
$config
[
'assess_order_num'
],
'invite_user_id'
=>
0
,
'invite_user_nick'
=>
''
,
'colonel_user_id'
=>
$orderNum
[
'colonel_user_id'
],
'colonel_user_id'
=>
$orderNum
[
'colonel_user_id'
],
];
}
}
...
...
@@ -161,9 +162,9 @@ class ColonelorderController extends Job
{
$config
=
ColonelDistributorConfig
::
getRecord
([
'date[<=]'
=>
$settlementDate
,
'type'
=>
ColonelDistributorConfig
::
TYPE_COLONEL
,
'ORDER'
=>
[
'date'
=>
'DESC'
],
'LIMIT'
=>
1
'type'
=>
ColonelDistributorConfig
::
TYPE_COLONEL
,
'ORDER'
=>
[
'date'
=>
'DESC'
],
'LIMIT'
=>
1
]);
$configData
=
[];
if
(
!
empty
(
$config
[
'data'
]))
{
...
...
@@ -183,7 +184,7 @@ class ColonelorderController extends Job
return
ColonelDistributorInviteOrderNum
::
getRecords
(
[
'colonel_user_id'
=>
$colonelUserIds
,
'date'
=>
$date
,
'date'
=>
$date
,
],
[
'colonel_user_id'
,
'num'
]
);
...
...
@@ -226,9 +227,9 @@ class ColonelorderController extends Job
$count
=
count
(
$data
);
$httpParams
=
[
[
'type'
=>
'goods'
,
'type'
=>
'goods'
,
'number'
=>
00
,
'count'
=>
$count
'count'
=>
$count
]
];
$res
=
Idgen
::
get
(
appConfig
(
'idgen.partner'
),
appConfig
(
'idgen.key'
),
[],
$httpParams
);
...
...
@@ -294,7 +295,7 @@ class ColonelorderController extends Job
$balance
=
(
$result
[
'capital_pool_total'
]
-
$result
[
'capital_pool_lock'
]
-
$result
[
'capital_pool_used'
]);
return
[
'marketing_id'
=>
$marketing
[
'marketing_id'
],
'balance'
=>
$balance
'balance'
=>
$balance
];
}
...
...
@@ -330,7 +331,7 @@ class ColonelorderController extends Job
private
function
loadTimeConfig
()
{
// 如果传入时间-使用指定时间
$params
=
$this
->
getRequest
()
->
getParams
()
;
$params
=
$this
->
params
;
if
(
empty
(
$params
[
'date'
])
||
!
strtotime
(
$params
[
'date'
]))
{
$timeRange
=
PindanActivityColonelConfigService
::
getSettlementTimeRange
();
$this
->
settlementDate
=
$timeRange
[
'date'
];
...
...
application/modules/Job/controllers/Colonelwallet.php
View file @
6ffb21b8
...
...
@@ -5,13 +5,14 @@
* Date: 2021/9/3 2:23 下午
*/
use
App\Base\Base
;
use
App\Base\Job
;
use
App\Models\marketing\mysql\ColonelDistributorPayInfo
;
use
Api\PhpUtils\Http\HttpUtil
;
use
Api\PhpUtils\Log\JobLog
;
use
App\Services\marketing\ColonelService
;
class
ColonelwalletController
extends
Job
class
ColonelwalletController
extends
Base
{
const
CAPITAL_POOL_OP
=
200
;
//200:团长奖励
const
WALLET_SERVICE_NAME
=
10
;
// 10生活圈优惠券,11营销活动
...
...
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