project package deadline limit

dev_aliyun
p31729568 5 years ago
parent acc9d603b3
commit d7c14c3501

@ -15,6 +15,8 @@ class ProjectPackages::SaveService
raise Error, '类型不存在' unless ProjectPackageCategory.where(id: params[:category_id]).exists? raise Error, '类型不存在' unless ProjectPackageCategory.where(id: params[:category_id]).exists?
params[:project_package_category_id] = params[:category_id].to_i params[:project_package_category_id] = params[:category_id].to_i
raise Error, '竞标截止时间不能小于当前时间' if params[:deadline_at].present? && params[:deadline_at].to_time < Time.now
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
package.assign_attributes(params) package.assign_attributes(params)
package.save! package.save!

Loading…
Cancel
Save