Post.php 517 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. use traits\model\SoftDelete;
  5. class Post extends Model
  6. {
  7. use SoftDelete;
  8. protected $name = 'post';
  9. // 开启自动写入时间戳字段
  10. protected $autoWriteTimestamp = 'int';
  11. // 定义时间戳字段名
  12. protected $createTime = 'create_time';
  13. protected $updateTime = 'update_time';
  14. protected $deleteTime = 'delete_time';
  15. public static function getPostList()
  16. {
  17. return self::column('post_name','post_code');
  18. }
  19. }