Article.php 593 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\model;
  3. class Article extends BaseModel
  4. {
  5. /**
  6. * @var string
  7. */
  8. protected $name = 'article';
  9. /**
  10. * @var array
  11. */
  12. protected $auto = [];
  13. /**
  14. * @var array
  15. */
  16. protected $insert = ['created_at','updated_at'];
  17. /**
  18. * @var array
  19. */
  20. protected $update = ['updated_at'];
  21. /**
  22. * 关联分类
  23. * @return \think\model\relation\BelongsTo
  24. */
  25. public function category()
  26. {
  27. return $this->belongsTo('ArticleCategory','category_id','id');
  28. }
  29. }