用户账变 用户钱包

This commit is contained in:
cano
2024-03-10 00:44:58 +08:00
parent 025dab4c2c
commit 6d242ae973
17 changed files with 1617 additions and 16 deletions

25
app/Tools/Logs.php Normal file
View File

@ -0,0 +1,25 @@
<?php
namespace App\Tools;
use Illuminate\Support\Facades\Log;
class Logs
{
static function ErrLog($title, \Exception $e, $params = []): void
{
Log::error(self::getTitle($title,'success:'), ['message' => $e->getMessage(), 'trace' => $e->getTrace(), 'params' => $params]);
}
static function SuccLog($title, $params = []): void
{
Log::error(self::getTitle($title,'error:'), $params);
}
static function getTitle($title,$prefix=''): string
{
return $title.' '.$prefix;
}
}

View File

@ -1,12 +1,19 @@
<?php
namespace App\Tools;
use Illuminate\Support\Carbon;
class Times
{
//获取当前时间
public static function getNowDateTime($format = 'Y-m-d H:i:s'): string
public static function getNowDateTime(string $format = 'Y-m-d H:i:s'): string
{
return date($format);
}
public static function getNowDateTimeAddDays(int $days, string $format = 'Y-m-d'): string
{
return Carbon::now()->addDays($days)->format($format);
}
}