forgeplus/app/controllers/api/v1/issues/authors_controller.rb

10 lines
382 B
Ruby

class Api::V1::Issues::AuthorsController < Api::V1::BaseController
before_action :require_public_and_member_above, only: [:index]
# 发布人列表
def index
@authors = User.joins(issues: :project).where(projects: {id: @project&.id})
@authors = @authors.order("users.id=#{current_user.id} desc").distinct
@authors = kaminary_select_paginate(@authors)
end
end