mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-08 16:57:26 +08:00
Update to v2.8.2 without release
- Try to add support for Anniversary 5 ticket - Update the song database > Well, there may be bugs with Anniversary 5 ticket. Remember it can only be used when the pack is on sale.
This commit is contained in:
@@ -764,6 +764,7 @@ def change_purchase():
|
||||
orig_price = request.form['orig_price']
|
||||
discount_from = request.form['discount_from']
|
||||
discount_to = request.form['discount_to']
|
||||
discount_reason = request.form['discount_reason']
|
||||
|
||||
if price:
|
||||
price = int(price)
|
||||
@@ -783,6 +784,10 @@ def change_purchase():
|
||||
discount_to, "%Y-%m-%dT%H:%M"))) * 1000
|
||||
else:
|
||||
discount_to = -1
|
||||
|
||||
if not discount_reason:
|
||||
discount_reason = ''
|
||||
|
||||
except:
|
||||
error = '数据错误 Wrong data.'
|
||||
flash(error)
|
||||
@@ -792,8 +797,8 @@ def change_purchase():
|
||||
c.execute(
|
||||
'''select exists(select * from purchase where purchase_name=:a)''', {'a': purchase_name})
|
||||
if c.fetchone() == (0,):
|
||||
c.execute('''insert into purchase values(?,?,?,?,?)''',
|
||||
(purchase_name, price, orig_price, discount_from, discount_to))
|
||||
c.execute('''insert into purchase values(?,?,?,?,?,?)''',
|
||||
(purchase_name, price, orig_price, discount_from, discount_to, discount_reason))
|
||||
|
||||
flash('购买项目添加成功 Successfully add the purchase.')
|
||||
else:
|
||||
|
||||
@@ -288,6 +288,7 @@ def get_all_purchase():
|
||||
|
||||
discount_from = None
|
||||
discount_to = None
|
||||
discount_reason = 'Yes' if i[5] == 'anni5tix' else 'No'
|
||||
|
||||
if i[3] and i[3] >= 0:
|
||||
discount_from = time.strftime(
|
||||
@@ -302,13 +303,15 @@ def get_all_purchase():
|
||||
items = []
|
||||
if y:
|
||||
for j in y:
|
||||
items.append({'item_id': j[1], 'type': j[2], 'amount':j[3]})
|
||||
items.append(
|
||||
{'item_id': j[1], 'type': j[2], 'amount': j[3]})
|
||||
|
||||
re.append({'purchase_name': i[0],
|
||||
'price': i[1],
|
||||
'orig_price': i[2],
|
||||
'discount_from': discount_from,
|
||||
'discount_to': discount_to,
|
||||
'discount_reason': discount_reason,
|
||||
'items': items
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user