|
|
@@ -61,17 +61,20 @@ class LiveOrderClass extends BaseClass
|
|
|
$orderSn = $live->orderSn ?? '';
|
|
|
$customList = LiveOrderCustomClass::getAllByCondition(['orderSn' => $orderSn], null, '*', null, true);
|
|
|
$num = 0;
|
|
|
+ $price = 0;
|
|
|
if (!empty($customList)) {
|
|
|
foreach ($customList as $it) {
|
|
|
$currentCustomId = $it->customId ?? 0;
|
|
|
if ($currentCustomId == $customId) {
|
|
|
$num = $it->num ?? 0;
|
|
|
+ $price = $it->price ?? 0;
|
|
|
$it->delete();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$live->customNum = bcsub($live->customNum, 1);
|
|
|
$live->itemNum = bcsub($live->itemNum, $num);
|
|
|
+ $live->itemAmount = bcsub($live->itemAmount, $price, 2);
|
|
|
$live->save();
|
|
|
}
|
|
|
|