|
|
|
@ -17,6 +17,11 @@ class ProjectPackages::SaveService
|
|
|
|
|
|
|
|
|
|
raise Error, '竞标截止时间不能小于当前时间' if params[:deadline_at].present? && params[:deadline_at].to_time < Time.now
|
|
|
|
|
|
|
|
|
|
if params[:min_price].blank? && params[:max_price].present?
|
|
|
|
|
params[:min_price] = params[:max_price]
|
|
|
|
|
params[:max_price] = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
package.assign_attributes(params)
|
|
|
|
|
package.save!
|
|
|
|
|