Category.php 701 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 分类模型
  6. */
  7. class Category Extends Model
  8. {
  9. // 开启自动写入时间戳字段
  10. protected $autoWriteTimestamp = 'int';
  11. // 定义时间戳字段名
  12. protected $createTime = 'createtime';
  13. protected $updateTime = 'updatetime';
  14. // 定义字段类型
  15. protected $type = [
  16. ];
  17. /**
  18. * 读取分类类型
  19. * @return array
  20. */
  21. public static function getTypeList()
  22. {
  23. $typelist = [
  24. 'default' => __('Default'),
  25. 'page' => __('Page'),
  26. 'article' => __('Article'),
  27. 'block' => __('Block'),
  28. ];
  29. return $typelist;
  30. }
  31. }