mirror of
http://124.126.16.154:8888/singularity/hyperf-admin.git
synced 2026-01-15 03:35:07 +08:00
perf: BaseModel created_at/updated_at 支持配置
This commit is contained in:
@@ -56,6 +56,9 @@ class ConfigProvider
|
||||
];
|
||||
}
|
||||
|
||||
define("MODEL_CREATED_AT_FIELD", env('MODEL_CREATED_AT_FIELD', 'created_at'));
|
||||
define("MODEL_UPDATED_AT_FIELD", env('MODEL_UPDATED_AT_FIELD', 'updated_at'));
|
||||
|
||||
return [
|
||||
'commands' => [],
|
||||
'dependencies' => [
|
||||
|
||||
@@ -14,9 +14,9 @@ class BaseModel extends Model
|
||||
{
|
||||
use InsertOnDuplicateKey;
|
||||
|
||||
const CREATED_AT = 'create_at';
|
||||
const CREATED_AT = MODEL_CREATED_AT_FIELD;
|
||||
|
||||
const UPDATED_AT = 'update_at';
|
||||
const UPDATED_AT = MODEL_UPDATED_AT_FIELD;
|
||||
|
||||
const STATUS_YES = YES;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user