作者 郭宇鹏
1 个管道 的构建 通过 耗费 1 秒

'12-30'

... ... @@ -89,7 +89,7 @@ class Index extends BaseApi
if ($attention == 2){
$art_list[$key]['is_friend'] = 1;
}else{
$art_list[$key]['is_friend'] = 1;
$art_list[$key]['is_friend'] = 0;
}
}
}
... ...
... ... @@ -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
... ...