Commit 688b7bcb authored by pengfei's avatar pengfei

update 团长分销-结算脚本,支持指定日期

parent 9ad9423a
......@@ -36,10 +36,7 @@ class ColonelorderController extends Job
public function init()
{
parent::init();
$timeRange = PindanActivityColonelConfigService::getSettlementTimeRange();
$this->settlementDate = $timeRange['date'];
$this->startTime = $timeRange['start_time'];
$this->endTime = $timeRange['end_time'];
$this->loadTimeConfig();
$this->colonelConfigList = $this->getColonelConfig($this->settlementDate);
}
......@@ -267,6 +264,28 @@ class ColonelorderController extends Job
return (int)ColonelDistributorPayInfo::save($data);
}
/**
* Notes: 加载配置
* User: pengfei@yidian-inc.com
* Date: 2021/9/8 7:43 下午
*/
private function loadTimeConfig()
{
// 如果传入时间-使用指定时间
$params = $this->getRequest()->getParams();
if (empty($params['date']) || strtotime($params['date'])) {
$timeRange = PindanActivityColonelConfigService::getSettlementTimeRange();
$this->settlementDate = $timeRange['date'];
$this->startTime = $timeRange['start_time'];
$this->endTime = $timeRange['end_time'];
} else {
$hour = PindanActivityColonelConfigService::ACTIVITY_DEFAULT_HOUR;
$this->settlementDate = $params['date'];
$this->startTime = "{$params['date']} $hour:00:00";
$this->endTime = strtotime($this->startTime . ' +1 day');
}
}
/**
* Notes: 记录 info 日志
* User: pengfei@yidian-inc.com
......
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