修复单件附魔书结算时 web_transactions 唯一约束冲突
This commit is contained in:
+8
-2
@@ -223,7 +223,12 @@ function shopBuy($token) {
|
||||
$stmt->bindValue(':player', $player, SQLITE3_TEXT);
|
||||
$stmt->bindValue(':amount', $totalPrice, SQLITE3_INTEGER);
|
||||
$stmt->bindValue(':reason', "购买: {$item['display_name']} x{$amount}", SQLITE3_TEXT);
|
||||
$stmt->bindValue(':detail', json_encode(['item_id' => $itemId, 'amount' => $amount, 'unit_price' => $item['buy_price']], JSON_UNESCAPED_UNICODE), SQLITE3_TEXT);
|
||||
$stmt->bindValue(':detail', json_encode([
|
||||
'item_id' => $itemId,
|
||||
'amount' => $amount,
|
||||
'unit_price' => $item['buy_price'],
|
||||
'tx_id' => bin2hex(random_bytes(8))
|
||||
], JSON_UNESCAPED_UNICODE), SQLITE3_TEXT);
|
||||
$stmt->bindValue(':time', time(), SQLITE3_INTEGER);
|
||||
$stmt->execute();
|
||||
|
||||
@@ -559,7 +564,8 @@ function shopBuyCart($token) {
|
||||
'discount_percent' => (int)$discountPercent,
|
||||
'discount_amount' => (int)$discountAmount,
|
||||
'pay_mode' => $payMode,
|
||||
'items' => $lines
|
||||
'items' => $lines,
|
||||
'tx_id' => bin2hex(random_bytes(8))
|
||||
];
|
||||
if ($settlement === 'shulker') {
|
||||
$detailData['shulker_color'] = $shulkerColor;
|
||||
|
||||
Reference in New Issue
Block a user