123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace addons\workorder\model;
- use think\Model;
- use traits\model\SoftDelete;
- /**
- * 知识库
- */
- class Kbs extends Model
- {
- use SoftDelete;
- // 表名
- protected $name = 'workorder_kbs';
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = 'int';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- protected $deleteTime = 'deletetime';
- protected $append = [
- 'createtime_text'
- ];
- protected static function init()
- {
- }
- public function getCreatetimeTextAttr($value, $data)
- {
- return human_date($data['createtime']);
- }
- }
|