|
|
@@ -47,10 +47,11 @@ class Order extends Api
|
|
|
// 启动事务
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
-
|
|
|
+
|
|
|
$amount = $ledgerWalletModel::getWalletChaBao($this->auth->id);
|
|
|
- if(bccomp($order_info['price'], $amount, 2) < 0) throw new Exception(__("余额不足请前往充值"), 300);
|
|
|
+ if(bccomp($order_info['price'], $amount, 2) > 0) throw new Exception(__("余额不足请前往充值"), 300);
|
|
|
if($order_info->stock == 0 || time() >= $order_info->end_time) throw new Exception(__("抢购已结束"));
|
|
|
+
|
|
|
// 生成订单
|
|
|
$productOrder->create($order_data);
|
|
|
//修改区域状态
|