36 lines
678 B
PHP
36 lines
678 B
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\admin\model\partmanage;
|
|
|
|
use think\Model;
|
|
/**
|
|
* 部件管理模型类
|
|
* <!--Partmanage-->
|
|
* @mixin Model
|
|
*/
|
|
class Partmanage extends Model
|
|
{
|
|
|
|
// 自动写入时间戳字段
|
|
protected $autoWriteTimestamp = 'int';
|
|
|
|
// 定义时间戳字段名
|
|
protected $createTime = 'create_time';
|
|
protected $updatetime = 'update_time';
|
|
|
|
/**
|
|
* 字段修改器
|
|
* @param $value
|
|
* @return int|mixed
|
|
*/
|
|
public function setSortAttr($value)
|
|
{
|
|
if (is_empty($value)) {
|
|
return self::max('id') + 1;
|
|
}
|
|
|
|
return $value;
|
|
}
|
|
}
|