Commit 30bf371e authored by pengfei's avatar pengfei

update 团长分销-奖励脚本增加日志

parent f2449dd3
...@@ -36,21 +36,23 @@ class ColonelorderController extends Cli ...@@ -36,21 +36,23 @@ class ColonelorderController extends Cli
public function indexAction() public function indexAction()
{ {
FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:start');
$userIdList = $this->getColonelUserIds(); $userIdList = $this->getColonelUserIds();
if (empty($userIdList) || empty($this->colonelConfigList)) { if (!empty($userIdList) && !empty($this->colonelConfigList)) {
return true; $userIdList = array_chunk($userIdList, self::DEFAULT_USER_BATCH_SIZE);
} $colonelPayInfoData = [];
$userIdList = array_chunk($userIdList, self::DEFAULT_USER_BATCH_SIZE); foreach ($userIdList as $userIds) {
$colonelPayInfoData = []; $batchPayInfoData = [];
foreach ($userIdList as $userIds) { // 完成目标单数
$batchPayInfoData = []; $batchPayInfoData[] = $this->getInviteOrderData($userIds);
// 完成目标单数 // 邀请新用户奖励
$batchPayInfoData[] = $this->getInviteOrderData($userIds); $batchPayInfoData[] = $this->getInviteNewUserData($userIds);
// 邀请新用户奖励 $colonelPayInfoData = array_merge($colonelPayInfoData, $batchPayInfoData);
$batchPayInfoData[] = $this->getInviteNewUserData($userIds); }
$colonelPayInfoData = array_merge($colonelPayInfoData, $batchPayInfoData); $this->handleSavePayInfo($colonelPayInfoData);
} }
return $this->handleSavePayInfo($colonelPayInfoData); FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:end');
echo "success";
} }
/** /**
...@@ -60,6 +62,7 @@ class ColonelorderController extends Cli ...@@ -60,6 +62,7 @@ class ColonelorderController extends Cli
*/ */
public function handleSavePayInfo($colonelPayInfoData) public function handleSavePayInfo($colonelPayInfoData)
{ {
FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:colonelPayInfoCount='.count($colonelPayInfoData));
if (!empty($colonelPayInfoData)) { if (!empty($colonelPayInfoData)) {
$data = $this->addIdgenId($colonelPayInfoData); $data = $this->addIdgenId($colonelPayInfoData);
try { try {
......
...@@ -13,8 +13,10 @@ class ColonelwalletController extends Cli ...@@ -13,8 +13,10 @@ class ColonelwalletController extends Cli
{ {
public function indexAction() public function indexAction()
{ {
FileLog::info("colonel_distributor_wallet", '团长分销-奖励钱包脚本:start');
$yesterday = date("Y-m-d", strtotime("-1 day")); $yesterday = date("Y-m-d", strtotime("-1 day"));
$payInfoList = $this->getPayInfo($yesterday); $payInfoList = $this->getPayInfo($yesterday);
FileLog::info("colonel_distributor_wallet", '团长分销-奖励钱包脚本:payInfoCount='.count($payInfoList));
if (!empty($payInfoList)) { if (!empty($payInfoList)) {
if ($this->toWallet($payInfoList)) { if ($this->toWallet($payInfoList)) {
if ($this->deductingInventory($payInfoList)) { if ($this->deductingInventory($payInfoList)) {
...@@ -22,6 +24,8 @@ class ColonelwalletController extends Cli ...@@ -22,6 +24,8 @@ class ColonelwalletController extends Cli
} }
} }
} }
FileLog::info("colonel_distributor_wallet", '团长分销-奖励钱包脚本:end');
echo "success";
} }
/** /**
......
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