master
wangxinglong 2021-12-20 10:34:00 +08:00
parent 504c48c71c
commit c261f15207
2 changed files with 4 additions and 4 deletions

View File

@ -137,9 +137,9 @@ class Consumer extends Base
$endTime = strtotime($item->end_time); $endTime = strtotime($item->end_time);
if (($endTime - $time) < $weekTime) { if (($endTime - $time) < $weekTime) {
$ExpirationTime = ($endTime - $time) / 86400; $ExpirationTime = ($endTime - $time) / 86400;
$item->ExpirationTime = ceil($ExpirationTime); $item->ExpirationTime = "还有" . ceil($ExpirationTime) . "到期";
} else { } else {
$item->ExpirationTime = 0; $item->ExpirationTime = '';
} }
}); });

View File

@ -115,9 +115,9 @@ class Coupon extends Base
$endTime = strtotime($item->endTime); $endTime = strtotime($item->endTime);
$ExpirationTime = abs(($endTime - $time) / 86400); $ExpirationTime = abs(($endTime - $time) / 86400);
if (($endTime > $time) ) { if (($endTime > $time) ) {
$expirationStr = ceil($ExpirationTime)."后到"; $expirationStr = "还有".ceil($ExpirationTime)."过期";
} else { } else {
$expirationStr = "" . ceil($ExpirationTime) . ""; $expirationStr = "已过" . ceil($ExpirationTime) . "";
} }
$item->expirationStr =$expirationStr; $item->expirationStr =$expirationStr;