28 lines
854 B
PHP
28 lines
854 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\YiiModels;
|
||
|
|
|
||
|
|
use App\Models\BaseModel;
|
||
|
|
use Illuminate\Support\Str;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* App\Models\YiiModels\YiiBaseModel
|
||
|
|
*
|
||
|
|
* @property-read string $created_at_format 创建时间的格式化
|
||
|
|
* @property-read string $status_string 状态名称
|
||
|
|
* @property-read string $updated_at_format 更新时间的格式化
|
||
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\YiiBaseModel newModelQuery()
|
||
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\YiiBaseModel newQuery()
|
||
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\YiiBaseModel query()
|
||
|
|
* @mixin \Eloquent
|
||
|
|
*/
|
||
|
|
class YiiBaseModel extends BaseModel
|
||
|
|
{
|
||
|
|
protected $dateFormat = 'U';
|
||
|
|
|
||
|
|
public function getTable(): string
|
||
|
|
{
|
||
|
|
return $this->table ?? Str::snake(class_basename($this));
|
||
|
|
}
|
||
|
|
}
|