Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
0308d641
Commit
0308d641
authored
Sep 24, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the seq of order
parent
8eab964e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
order.rb
lib/shotengai/order.rb
+10
-2
No files found.
lib/shotengai/order.rb
View file @
0308d641
...
...
@@ -64,6 +64,10 @@ module Shotengai
# event :soft_delete
end
def
manager
snapshots
.
first
.
manager
end
def
status_zh
{
unpaid:
'未支付'
,
...
...
@@ -99,10 +103,14 @@ module Shotengai
end
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
=
(
"%0
#{
no_length
}
d"
%
id
).
last
no_length
self
.
update!
(
seq:
"
#{
timestamp
}
-
#{
no
}
"
)
"s
#{
timestamp
}
_
#{
no
}
"
end
def
set_amount
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment