Commit f4a98964 authored by 顾文旭's avatar 顾文旭

log

parent 02bab96b
......@@ -445,6 +445,11 @@ class Tcc2Service
//T时候执行C2,条件加上乐观锁
if ($tccInfo["status"] == Tcc::STATUS_C1_SUCCESS) {
try {
$goodsSku = PindanGoodsSku::getRecord(["goods_sku_id" => $goodsSkuId]);
FileLog::info("Tcc inventory_rest add start ", "tid:" . $tid . " num:" . $num . " goods_sku_id" . $goodsSkuId
. " total_amount_order: " . $goodsSku['total_amount_order'] . " inventory_rest:" . $goodsSku['inventory_rest'] .
" total_amount_sold:" . $goodsSku['total_amount_sold'] . " inventory_total:" . $goodsSku['inventory_total']);
$rowCount = PindanGoodsSku::save([
"total_amount_order[-]" => $num,
"inventory_rest[+]" => $num,
......@@ -453,6 +458,18 @@ class Tcc2Service
PindanGoodsSku::rollback();
throw new GoodsException(["cus" => 32]);
}
FileLog::info("Tcc inventory_rest add end", "tid:" . $tid . " num:" . $num . " goods_sku_id" . $goodsSkuId
. " total_amount_order: " . $goodsSku['total_amount_order'] . " inventory_rest:" . $goodsSku['inventory_rest']
. " total_amount_sold:" . $goodsSku['total_amount_sold'] . " inventory_total:" . $goodsSku['inventory_total']);
if ($goodsSku['inventory_rest'] + $goodsSku['total_amount_sold'] > $goodsSku['inventory_total']) {
FileLog::error("Tcc inventory_rest add error", " inventory_rest:" . $goodsSku['inventory_rest'] .
" total_amount_sold:" . $goodsSku['total_amount_sold'] . " inventory_total:" . $goodsSku['inventory_total']);
}
} catch (\Exception $e) {
FileLog::error("Tcc inventory_rest add Exception", $e->getMessage());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment