|
|
@@ -101,8 +101,8 @@ class Order extends Api
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
|
|
|
- //$amount = $ledgerWalletModel::getWalletTotalChaBao($this->auth->id);
|
|
|
- //if(bccomp($order_info->freight, $amount, 2) > 0) throw new Exception(__("余额不足请前往充值"), 15001);
|
|
|
+ $amount = $ledgerWalletModel::getWalletChaBao($this->auth->id);
|
|
|
+ if(bccomp($order_info->freight, $amount, 2) > 0) throw new Exception(__("余额不足请前往充值"), 15001);
|
|
|
|
|
|
// 生成订单
|
|
|
$userArea->create(['name'=>$params['name'], 'type_id'=>$userArea::TakeAdders, 'phone'=>$params['phone'],'address'=>$params['address'],'order_id'=>$params['order_id']]);
|
|
|
@@ -111,7 +111,8 @@ class Order extends Api
|
|
|
if(!empty($order_info->is_show) && $order_info->popular_price > config('min_rwa_price')) $userModel::updateForRwaNum($order_info->user_id, $userModel::getByParentId($order_info->user_id), 1, '-');
|
|
|
|
|
|
//扣除运费
|
|
|
- //if($order_info->freight > 0) $ledgerWalletModel->setChangeFrozen($this->auth->id, $order_info->freight, LedgerFrozenChangeModel::Freight, '-');
|
|
|
+ if($order_info->freight > 0) $ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::TOKEN, -$order_info->freight, LedgerTokenChangeModel::Freight, $this->auth->id);
|
|
|
+
|
|
|
|
|
|
$order_info->type_id = $productOrder::Popular;
|
|
|
$order_info->status = $productOrder::Shipped;
|