Commit d5e7bb31 authored by pengfei's avatar pengfei

update 团长分销-奖励脚本

parent 1789292b
...@@ -101,7 +101,7 @@ class ColonelorderController extends Job ...@@ -101,7 +101,7 @@ class ColonelorderController extends Job
*/ */
private function getInviteNewUserData($userIds, &$colonelPayInfoData) private function getInviteNewUserData($userIds, &$colonelPayInfoData)
{ {
if ($inviteNewUserList = $this->getInviteNewUserList($userIds)) { if ($inviteNewUserList = $this->getInviteNewUserList($userIds,$this->startTime,$this->endTime)) {
$userNickList = $this->getUserList(array_column($inviteNewUserList, 'user_id')); $userNickList = $this->getUserList(array_column($inviteNewUserList, 'user_id'));
foreach ($inviteNewUserList as $newUser) { foreach ($inviteNewUserList as $newUser) {
$colonelPayInfoData[] = [ $colonelPayInfoData[] = [
...@@ -148,24 +148,19 @@ class ColonelorderController extends Job ...@@ -148,24 +148,19 @@ class ColonelorderController extends Job
/** /**
* 团长任务配置 * 团长任务配置
* @param $yesterday * @param $settlementDate
* @return array * @return array
*/ */
private function getColonelConfig($yesterday): array private function getColonelConfig($settlementDate): array
{ {
$config = ColonelDistributorConfig::getRecord([ $config = ColonelDistributorConfig::getRecord([
'date' => $yesterday, 'date[<=]' => $settlementDate,
'type' => ColonelDistributorConfig::TYPE_COLONEL 'type' => ColonelDistributorConfig::TYPE_COLONEL,
'ORDER' => ['date' => 'DESC'],
'LIMIT' => 1
]); ]);
if (empty($config)) {
$config = ColonelDistributorConfig::getRecord([
'date[<=]' => $yesterday,
'ORDER' => ['date' => 'DESC'],
'LIMIT' => 1
]);
}
$configData = []; $configData = [];
if (empty($config['data'])) { if (!empty($config['data'])) {
$configData = json_decode($config['data'], true); $configData = json_decode($config['data'], true);
} }
return $configData; return $configData;
...@@ -193,10 +188,12 @@ class ColonelorderController extends Job ...@@ -193,10 +188,12 @@ class ColonelorderController extends Job
* User: pengfei@yidian-inc.com * User: pengfei@yidian-inc.com
* Date: 2021/9/3 4:03 下午 * Date: 2021/9/3 4:03 下午
* @param $userIds * @param $userIds
* @param $startTime
* @param $endTime
* @return array * @return array
* @throws InterfaceException * @throws InterfaceException
*/ */
private function getInviteNewUserList($userIds): array private function getInviteNewUserList($userIds,$startTime,$endTime): array
{ {
$url = config('interface', 'coupon.background.wx_invite_relation_list_by_user_ids'); $url = config('interface', 'coupon.background.wx_invite_relation_list_by_user_ids');
if (empty($url)) { if (empty($url)) {
...@@ -204,7 +201,7 @@ class ColonelorderController extends Job ...@@ -204,7 +201,7 @@ class ColonelorderController extends Job
} }
$res = HttpUtil::get($url, $res = HttpUtil::get($url,
['user_ids' => $userIds, 'start_time' => $this->startTime, 'end_time' => $this->endTime]); ['user_ids' => $userIds, 'start_time' => $startTime, 'end_time' => $endTime]);
if (!empty($res['response']['result'])) { if (!empty($res['response']['result'])) {
return array_values(array_column($res['response']['result'], null, 'user_id')); return array_values(array_column($res['response']['result'], null, 'user_id'));
} }
......
...@@ -34,6 +34,8 @@ class ColonelwalletController extends Job ...@@ -34,6 +34,8 @@ class ColonelwalletController extends Job
if ($this->toWallet($payInfoList)) { if ($this->toWallet($payInfoList)) {
if ($this->handlePayInfoStatus(array_column($payInfoList, 'pay_info_id'))) { if ($this->handlePayInfoStatus(array_column($payInfoList, 'pay_info_id'))) {
$this->loggerInfo('success'); $this->loggerInfo('success');
} else {
$this->loggerInfo('更新状态失败');
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment