Kbs.php 678 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace addons\workorder\model;
  3. use think\Model;
  4. use traits\model\SoftDelete;
  5. /**
  6. * 知识库
  7. */
  8. class Kbs extends Model
  9. {
  10. use SoftDelete;
  11. // 表名
  12. protected $name = 'workorder_kbs';
  13. // 自动写入时间戳字段
  14. protected $autoWriteTimestamp = 'int';
  15. // 定义时间戳字段名
  16. protected $createTime = 'createtime';
  17. protected $updateTime = 'updatetime';
  18. protected $deleteTime = 'deletetime';
  19. protected $append = [
  20. 'createtime_text'
  21. ];
  22. protected static function init()
  23. {
  24. }
  25. public function getCreatetimeTextAttr($value, $data)
  26. {
  27. return human_date($data['createtime']);
  28. }
  29. }