feat(orm): upgrade think-orm to version 4.0 and add BaseEntity class

- Upgrade topthink/think-orm from ^3.0 to ^4.0 in composer.json
- Add new BaseEntity class in app/common/entity to handle common entity options
This commit is contained in:
wolfcode
2025-02-14 16:12:12 +08:00
parent b510042323
commit 973e9cb24c
4 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace app\common\entity;
use think\Entity;
use think\model\type\DateTime;
class BaseEntity extends Entity
{
protected function getOptions(): array
{
return [
'type' => [
'create_time' => DateTime::class,
'update_time' => DateTime::class,
'delete_time' => DateTime::class,
],
];
}
}