update member discount and seed for detail
This commit is contained in:
@@ -60,8 +60,15 @@ class SeedGenerator < ApplicationRecord
|
||||
seed.save
|
||||
end
|
||||
|
||||
padding_len = 5 - prefix.length
|
||||
next_code = prefix + seed.current.to_s.to_s.rjust((4-prefix.length)+1,'0')
|
||||
|
||||
if prefix.length == 1
|
||||
padding_len = 5 - prefix.length
|
||||
count = 4-prefix.length
|
||||
else prefix.length == 2
|
||||
padding_len = 6 - prefix.length
|
||||
count = 5-prefix.length
|
||||
end
|
||||
next_code = prefix + seed.current.to_s.to_s.rjust((count)+1,'0')
|
||||
return next_code
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user