1、帖子搜索
2、收藏搜索 3、帖子、评论删除
This commit is contained in:
@@ -40,7 +40,7 @@ class Post extends Model
|
||||
/**
|
||||
* 允许自动填充模型字段
|
||||
*/
|
||||
protected $fillable = ['id', 'user_id', 'category_id', 'content', 'location_name', 'latitude', 'longitude', 'status', 'sort', 'created_at', 'updated_at'];
|
||||
protected $fillable = ['id', 'user_id', 'category_id', 'content', 'location_name', 'latitude', 'longitude', 'status', 'sort', 'like', 'favorite', 'comment', 'browse', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* 不允许自动填充模型字段
|
||||
|
||||
@@ -46,4 +46,9 @@ class PostFavorite extends Model
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
public function post()
|
||||
{
|
||||
return $this->hasOne('app\common\model\Post', 'id', 'post_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user