mirror of
https://github.com/henry4682/finance_app.git
synced 2026-07-16 00:10:00 +00:00
fix: add md & fix dateformat & add note
All checks were successful
Laravel-Oracle-Deploy / redeploy (push) Successful in 1m10s
All checks were successful
Laravel-Oracle-Deploy / redeploy (push) Successful in 1m10s
This commit is contained in:
@@ -57,7 +57,8 @@ class UpdateAssetPriceJob implements ShouldQueue
|
||||
$latestPrice = floatval($info['z'] ?? $info['o'] ?? 0);
|
||||
$latestPriceDate = isset($info['d']) ? Carbon::parse($info['d'])->format('Y-m-d') : now()->format('Y-m-d');
|
||||
$name = $info['n'] ?? $this->defaultName;
|
||||
|
||||
// 忘了備份時用的
|
||||
// $latestPriceDate = isset($info['d']) ? Carbon::parse($info['d'], 'Asia/Taipei')->subDay()->format('Y-m-d') : now()->subDay()->format('Y-m-d');
|
||||
if (isset($info['y']) && $latestPrice > 0) {
|
||||
$changeAmount = floatval($latestPrice - $info['y']);
|
||||
$changeRate = ($changeAmount / $info['y']) * 100;
|
||||
@@ -88,7 +89,9 @@ class UpdateAssetPriceJob implements ShouldQueue
|
||||
}
|
||||
|
||||
if ($headerInfo) {
|
||||
$latestPriceDate = isset($headerInfo['navDate']) ? substr($headerInfo['navDate'], 0, 10) : now()->format('Y-m-d');
|
||||
$latestPriceDate = isset($headerInfo['navDate']) ? Carbon::parse($headerInfo['navDate'], 'Asia/Taipei')->format('Y-m-d') : now()->format('Y-m-d');
|
||||
// 忘了備份時用的
|
||||
// $latestPriceDate = isset($headerInfo['navDate']) ? Carbon::parse($headerInfo['navDate'], 'Asia/Taipei')->subDay()->format('Y-m-d') : now()->subDay()->format('Y-m-d');
|
||||
$latestPrice = floatval($headerInfo['nav'] ?? 0);
|
||||
|
||||
if ($latestPriceDate !== now()->format('Y-m-d')) {
|
||||
|
||||
Reference in New Issue
Block a user