From 886de85be1f96517ffadc5b9202a84681944c78a Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 13 Jul 2019 16:55:14 +0800 Subject: [PATCH] fix project package time --- app/api/mobile/apis/project_packages.rb | 4 ++-- app/api/mobile/entities/project_package.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/mobile/apis/project_packages.rb b/app/api/mobile/apis/project_packages.rb index d17a154b..5570304a 100644 --- a/app/api/mobile/apis/project_packages.rb +++ b/app/api/mobile/apis/project_packages.rb @@ -100,7 +100,7 @@ module Mobile requires :title, type: String, desc: '标题' requires :content, type: String, desc: '描述' optional :attachment_ids, type: Array[Integer], desc: '附件ID数组' - requires :deadline_at, type: DateTime, desc: '截止日期' + requires :deadline_at, type: String, desc: '截止日期' optional :min_price, type: Float, desc: '最小费用' optional :max_price, type: Float, desc: '最大费用' requires :contact_name, type: String, desc: '联系人姓名' @@ -128,7 +128,7 @@ module Mobile requires :title, type: String, desc: '标题' requires :content, type: String, desc: '描述' optional :attachment_ids, type: Array[Integer], desc: '附件ID数组' - requires :deadline_at, type: DateTime, desc: '截止日期' + requires :deadline_at, type: String, desc: '截止日期' optional :min_price, type: Float, desc: '最小费用' optional :max_price, type: Float, desc: '最大费用' requires :contact_name, type: String, desc: '联系人姓名' diff --git a/app/api/mobile/entities/project_package.rb b/app/api/mobile/entities/project_package.rb index 684913e7..9871dcef 100644 --- a/app/api/mobile/entities/project_package.rb +++ b/app/api/mobile/entities/project_package.rb @@ -21,13 +21,13 @@ module Mobile expose :contact_phone, if: ->(package, opts){ opts[:user].id == package.creator_id || opts[:user].admin? || opts[:user].business? } expose :updated_at do |package, _| - package.updated_at.try(:utc).try(:iso8601) + package.updated_at.strftime('%Y-%m-%d %H:%M:%S') end expose :deadline_at do |package, _| - package.deadline_at.try(:utc).try(:iso8601) + package.deadline_at.try(:strftime, '%Y-%m-%d %H:%M:%S') end expose :published_at do |package, _| - package.published_at.try(:utc).try(:iso8601) + package.published_at.try(:strftime, '%Y-%m-%d %H:%M:%S') end expose :creator, if: { type: :show } do |package, _|