...
|
...
|
@@ -9,7 +9,7 @@ class Article extends BaseModel |
|
|
|
|
|
// 追加属性
|
|
|
protected $append = [
|
|
|
'str_time'
|
|
|
'str_time','article_category'
|
|
|
];
|
|
|
|
|
|
|
...
|
...
|
@@ -35,6 +35,13 @@ class Article extends BaseModel |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取栏目数据
|
|
|
*/
|
|
|
public function getArticleCategoryAttr($value,$data){
|
|
|
return model('article_category')->where('id',$data['article_category_id'])->find();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 关联用户表
|
|
|
*/
|
|
|
public function User(){
|
...
|
...
|
@@ -43,4 +50,6 @@ class Article extends BaseModel |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|