|
|
@@ -102,7 +102,7 @@ class Market extends Api
|
|
|
$params = $this->request->post();
|
|
|
$validate = \think\Loader::validate('Market');
|
|
|
if(!$validate->scene('buying')->check($params)) $this->error($validate->getError());
|
|
|
- if($productBuying::getProductBuyingCount($this->auth->id, $params['product_id']) > config('market_buying.max_buying_num')) $this->error('您的求购次数已达上限');
|
|
|
+ if($productBuying::getProductBuyingCount($this->auth->id, $params['product_id']) > config('market_transfer.max_buying_num')) $this->error('您的求购次数已达上限');
|
|
|
$chabao = $ledgerWalletModel::getWalletChaBao($this->auth->id);
|
|
|
$total = bcmul($params['min_price'], $params['num'], 6); // 所需茶宝
|
|
|
if($chabao < $total) $this->error('您的茶币不足');
|
|
|
@@ -195,6 +195,7 @@ class Market extends Api
|
|
|
try {
|
|
|
|
|
|
$buying =$ledgerWalletModel::getWalletBuying($this->auth->id);
|
|
|
+
|
|
|
// 添加扣除茶币
|
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::TOKEN, $buying, LedgerTokenChangeModel::BuyCancel, $buying->user_id);
|
|
|
|