Commit 30bf371e authored by pengfei's avatar pengfei

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

parent f2449dd3
......@@ -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->getInviteOrderData($userIds);
// 邀请新用户奖励
$batchPayInfoData[] = $this->getInviteNewUserData($userIds);
$colonelPayInfoData = array_merge($colonelPayInfoData, $batchPayInfoData);
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->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
*/
public function handleSavePayInfo($colonelPayInfoData)
{
FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:colonelPayInfoCount='.count($colonelPayInfoData));
if (!empty($colonelPayInfoData)) {
$data = $this->addIdgenId($colonelPayInfoData);
try {
......
......@@ -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";
}
/**
......
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