初始化项目
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
2025-05-12 00:19:35 +08:00
parent f6e4638ee6
commit fc327e9f48
27 changed files with 11107 additions and 29 deletions

26
app/BaseApp/BaseModel.php Executable file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\BaseApp;
use Illuminate\Database\Eloquent\Model;
class BaseModel extends Model
{
protected $connection = 'mysql';
public $timestamps = false;
public function getCreatedAtAttribute($value): string
{
if (empty($value)) {
return '';
}
return date('Y-m-d H:i:s', $value);
}
// 定义访问器,将 created_at 字段格式化为指定格式
public function getUpdatedAtAttribute($value): string
{
if (empty($value)) {
return '';
}
return date('Y-m-d H:i:s', $value);
}
}