This commit is contained in:
hellcat 2025-03-20 19:32:19 +08:00
parent 9f67098c17
commit c7f0d65adc

View File

@ -489,14 +489,25 @@ final class Cron
$oDucksAll = $oDucks->orderBy('code')->get(); $oDucksAll = $oDucks->orderBy('code')->get();
foreach ($oDucksAll as $oDucksRow) { foreach ($oDucksAll as $oDucksRow) {
$targetDate = new DateTime($oZhuanfasRow->end_date); if ($oDucksRow->width_reset_day > date('d')) {
$iWidthResetDay = $oDucksRow->width_reset_day - date('d');
} else {
$date = new DateTime();
$date->modify('first day of next month');
$date->setDate((int)$date->format('Y'), (int)$date->format('m'), $oDucksRow->width_reset_day);
$sEndDate = $date;
$currentDate = new DateTime();
$interval = $currentDate->diff($sEndDate);
$iWidthResetDay = $interval->days;
}
$oTgSendFormat->rowAdd( $oTgSendFormat->rowAdd(
$oDucksRow->code, $oDucksRow->code,
$iDuckFlowToday[$oDucksRow->code] ?? 0, $iDuckFlowToday[$oDucksRow->code] ?? 0,
$oDucksRow->use_width, $oDucksRow->use_width,
$oDucksRow->max_width, $oDucksRow->max_width,
$oDucksRow->width_reset_day - date('d') $iWidthResetDay
); );
} }