|
|
@@ -150,9 +150,7 @@ class Teac extends Api
|
|
|
if(empty($row) || $row['status'] != ProductTeac::Normal) $this->error('订单不存在');
|
|
|
if($this->auth->id == $row['user_id']) $this->error('不能购买自己的订单');
|
|
|
if($params['num'] > $row['stock'] - $row['num']) $this->error('库存不足');
|
|
|
- $chabao = $ledgerWalletModel->getWalletChaBao(1044);
|
|
|
- $tatal = bcmul($row['price'], $params['num'], 2);
|
|
|
- if($chabao < $tatal) $this->error('您的钱包茶宝余额不足');
|
|
|
+
|
|
|
// 启动事务
|
|
|
Db::startTrans();
|
|
|
try {
|