Commit 0308d641 by ivan Lan

Improve the seq of order

parent 8eab964e
...@@ -64,6 +64,10 @@ module Shotengai ...@@ -64,6 +64,10 @@ module Shotengai
# event :soft_delete # event :soft_delete
end end
def manager
snapshots.first.manager
end
def status_zh def status_zh
{ {
unpaid: '未支付', unpaid: '未支付',
...@@ -99,10 +103,14 @@ module Shotengai ...@@ -99,10 +103,14 @@ module Shotengai
end end
def set_seq def set_seq
timestamp = Time.now.strftime("%Y%m%d-%H%M") self.update!(seq: create_seq)
end
def create_seq
timestamp = Time.now.strftime("%Y%m%d_%H%M")
no_length = 4 no_length = 4
no = ("%0#{no_length}d" % id).last no_length no = ("%0#{no_length}d" % id).last no_length
self.update!(seq: "#{timestamp}-#{no}") "s#{timestamp}_#{no}"
end end
def set_amount def set_amount
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment