|
|
@@ -161,7 +161,7 @@ class Market extends Api
|
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::TOKEN, $chabao, LedgerTokenChangeModel::BuySellg, $buying->user_id);
|
|
|
|
|
|
// 扣除冻结金额
|
|
|
- $ledgerWalletModel->changeWalletOnly($this->auth->id, Asset::BUYING, -$chabao); //解冻金额
|
|
|
+ $ledgerWalletModel->changeWalletOnly($buying->user_id, Asset::BUYING, -$chabao); //解冻金额
|
|
|
|
|
|
if($buying->num == 1) $buying->status = ProductBuying::SaleOut;
|
|
|
$buying->num = $buying->num +1;
|
|
|
@@ -187,7 +187,6 @@ class Market extends Api
|
|
|
if(empty($buying)) $this->error('订单不存在');
|
|
|
if($buying->user_id!= $this->auth->id) $this->error('无权操作');
|
|
|
if($buying->status != ProductBuying::Normal) $this->error('订单已完成');
|
|
|
-
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
|
|
|
@@ -195,6 +194,9 @@ class Market extends Api
|
|
|
// 添加扣除茶币
|
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::TOKEN, $buying, LedgerTokenChangeModel::BuyCancel, $buying->user_id);
|
|
|
|
|
|
+ // 扣除冻结金额
|
|
|
+ $ledgerWalletModel->changeWalletOnly($buying->user_id, Asset::BUYING, -$buying); //解冻金额
|
|
|
+
|
|
|
$buying->status = ProductBuying::Close;
|
|
|
$buying->save();
|
|
|
// 提交事务
|