|
|
@@ -23,7 +23,10 @@ |
|
|
class IdentityVerification < ApplicationRecord |
|
|
class IdentityVerification < ApplicationRecord |
|
|
belongs_to :user |
|
|
belongs_to :user |
|
|
enum state: { "待审核": 0, "已通过": 1, "已拒绝": 2} |
|
|
enum state: { "待审核": 0, "已通过": 1, "已拒绝": 2} |
|
|
|
|
|
|
|
|
|
|
|
after_create do |
|
|
|
|
|
Attachment.where(id:[card_front,card_back,hold_card_front,hold_card_back]).update_all(is_public:0) |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
after_save do |
|
|
after_save do |
|
|
if state == "已通过" |
|
|
if state == "已通过" |
|
|
user.update(id_card_verify: true, website_permission: true) |
|
|
user.update(id_card_verify: true, website_permission: true) |
|
|
|