afa 6 сар өмнө
parent
commit
3f0dfdfd43

+ 2 - 2
application/api/controller/Market.php

@@ -105,11 +105,11 @@ class Market extends Api
         if($productBuying::getProductBuyingCount($this->auth->id, $params['product_id']) > config('market_transfer.max_buying_count')) $this->error('您的求购次数已达上限');
         
         $order_info = ProductLists::get($params['product_id']);
+        if(!$order_info) $this->error('参数有误');
         if($params['min_price'] < $order_info->min_buying_token || $params['min_price'] > $order_info->max_buying_token) $this->error(__("当前订单求购茶宝为").$order_info->min_buying_token.'~'.$order_info->max_buying_token);
-       
         $chabao     =  $ledgerWalletModel::getWalletChaBao($this->auth->id);
         $total      = bcmul($params['min_price'], $params['stock'], 6); // 所需茶宝
-      
+       
         if($chabao < $total) $this->error('您的茶币不足');
         // 启动事务
         Db::startTrans();