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
aab21e3a
Commit
aab21e3a
authored
Sep 10, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 团长分销-奖励脚本,修改调用钱包service_name
parent
29b46363
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
22 deletions
+37
-22
Colonelorder.php
application/modules/Job/controllers/Colonelorder.php
+2
-19
Colonelwallet.php
application/modules/Job/controllers/Colonelwallet.php
+17
-3
ColonelService.php
application/services/marketing/ColonelService.php
+18
-0
No files found.
application/modules/Job/controllers/Colonelorder.php
View file @
aab21e3a
...
...
@@ -17,6 +17,7 @@ use App\Models\marketing\mysql\Marketing;
use
App\Models\user\mysql\UserWechatBind
;
use
App\Services\marketing\PindanActivityColonelConfigService
;
use
Api\PhpUtils\Log\JobLog
;
use
App\Services\marketing\ColonelService
;
class
ColonelorderController
extends
Job
{
...
...
@@ -278,7 +279,7 @@ class ColonelorderController extends Job
if
(
!
$url
=
config
(
'interface'
,
'coupon.capitalpool.detail'
))
{
throw
new
Exception
(
'没有capitalpool配置'
);
}
if
(
!
$marketing
=
$this
->
getMarketingInfo
())
{
if
(
!
$marketing
=
ColonelService
::
getMarketingInfo
())
{
throw
new
Exception
(
'没有获取到资金池'
);
}
$httpParams
=
[
...
...
@@ -321,24 +322,6 @@ class ColonelorderController extends Job
}
}
/**
* Notes: 获取团长分销活动
* User: pengfei@yidian-inc.com
* Date: 2021/9/9 6:06 下午
* @return array
*/
private
function
getMarketingInfo
()
:
array
{
$where
=
[
'marketing_type'
=>
Marketing
::
MARKETING_TYPE_TUANZHANG
,
'ORDER'
=>
[
'marketing_id'
=>
'DESC'
],
// 'online_status' => Marketing::ONLINE_STATUS_QIDONG TODO 待确认状态
];
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$marketing
=
Marketing
::
getRecord
(
$where
,
[
'marketing_id'
,
'capital_pool_id'
]);
return
(
array
)
$marketing
;
}
/**
* Notes: 加载配置
* User: pengfei@yidian-inc.com
...
...
application/modules/Job/controllers/Colonelwallet.php
View file @
aab21e3a
...
...
@@ -9,14 +9,28 @@ 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
{
const
CAPITAL_POOL_ID
=
2
;
// 资金池id
const
CAPITAL_POOL_OP
=
200
;
//200:团长奖励
const
WALLET_SERVICE_NAME
=
1
1
;
// 10生活圈优惠券,11营销活动
const
WALLET_SERVICE_NAME
=
1
0
;
// 10生活圈优惠券,11营销活动
const
WALLET_SOURCE_NAME
=
1
;
//使用方名,1生活圈,2主端
public
$capitalPoolId
=
null
;
/**
* Notes: 初始化-读取配置
* User: pengfei@yidian-inc.com
* Date: 2021/9/10 10:01 上午
*/
public
function
init
()
{
parent
::
init
();
$marketing
=
ColonelService
::
getMarketingInfo
();
$this
->
capitalPoolId
=
$marketing
[
'capital_pool_id'
]
??
0
;
}
/**
* Notes: 奖励结算脚本
* User: pengfei@yidian-inc.com
...
...
@@ -95,7 +109,7 @@ class ColonelwalletController extends Job
throw
new
Exception
(
'没有grant_user_amount配置'
);
}
$httpParams
=
[
'capital_pool_id'
=>
self
::
CAPITAL_POOL_ID
'capital_pool_id'
=>
$this
->
capitalPoolId
];
$body
=
[];
foreach
(
$payInfoList
as
$payInfo
)
{
...
...
application/services/marketing/ColonelService.php
View file @
aab21e3a
...
...
@@ -12,6 +12,7 @@ use App\Models\marketing\mysql\ColonelDistributorColonel;
use
App\Models\marketing\mysql\ColonelDistributorColonelApply
;
use
App\Models\marketing\mysql\TakePlace
;
use
App\Models\user\mysql\UserWechatBind
;
use
App\Models\marketing\mysql\Marketing
;
use
Exception
;
class
ColonelService
...
...
@@ -323,4 +324,21 @@ class ColonelService
$takePlaces
=
TakePlace
::
getRecords
([
'take_place_id'
=>
$takePlaceId
]);
return
array_column
((
array
)
$takePlaces
,
null
,
'take_place_id'
);
}
/**
* Notes: 获取团长分销活动
* User: pengfei@yidian-inc.com
* Date: 2021/9/9 6:06 下午
* @return array
*/
public
static
function
getMarketingInfo
()
:
array
{
$where
=
[
'marketing_type'
=>
Marketing
::
MARKETING_TYPE_TUANZHANG
,
'ORDER'
=>
[
'marketing_id'
=>
'DESC'
],
];
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$marketing
=
Marketing
::
getRecord
(
$where
,
[
'marketing_id'
,
'capital_pool_id'
]);
return
(
array
)
$marketing
;
}
}
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