| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace app\common\model;
- class Article extends BaseModel
- {
- /**
- * @var string
- */
- protected $name = 'article';
- /**
- * @var array
- */
- protected $auto = [];
- /**
- * @var array
- */
- protected $insert = ['created_at','updated_at'];
- /**
- * @var array
- */
- protected $update = ['updated_at'];
- /**
- * 关联分类
- * @return \think\model\relation\BelongsTo
- */
- public function category()
- {
- return $this->belongsTo('ArticleCategory','category_id','id');
- }
- }
|