|
|
|
@ -15,6 +15,8 @@ class ProjectPackages::SaveService
|
|
|
|
|
raise Error, '类型不存在' unless ProjectPackageCategory.where(id: params[:category_id]).exists?
|
|
|
|
|
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
|
|
|
|
|
package.assign_attributes(params)
|
|
|
|
|
package.save!
|
|
|
|
|