Browse Source

新增:发表issue奖励

pull/317/head
qyzh 5 years ago
parent
commit
8b11fb604a
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      app/controllers/issues_controller.rb

+ 9
- 0
app/controllers/issues_controller.rb View File

@@ -141,6 +141,15 @@ class IssuesController < ApplicationController
end

@issue.project_trends.create(user_id: current_user.id, project_id: @project.id, action_type: "create")

########## sponsor
amount = 2
user_wallet = current_user.get_wallet
user_wallet.receive(amount)
reason = "创建任务"
CoinChange.create(amount: amount, reason: reason, to_wallet_id: user_wallet.id)
##########

render json: {status: 0, message: "创建成", id: @issue.id}
else
normal_status(-1, "创建失败")


Loading…
Cancel
Save