用户账变 用户钱包
This commit is contained in:
25
app/Tools/Logs.php
Normal file
25
app/Tools/Logs.php
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user