作者 耿培杰

修改订单付款接口

@@ -280,6 +280,7 @@ class Goods extends Model @@ -280,6 +280,7 @@ class Goods extends Model
280 $sum_stock_num = $this->alias('g') 280 $sum_stock_num = $this->alias('g')
281 ->join('fa_depot d','g.id=d.goods_id') 281 ->join('fa_depot d','g.id=d.goods_id')
282 ->where(['g.id' => $goodsId]) 282 ->where(['g.id' => $goodsId])
  283 + ->where('type',1)
283 ->field('d.id,d.stock_num') 284 ->field('d.id,d.stock_num')
284 ->sum('d.stock_num'); 285 ->sum('d.stock_num');
285 if($number > $sum_stock_num){ 286 if($number > $sum_stock_num){
@@ -150,8 +150,9 @@ class IntegralGoods extends Model @@ -150,8 +150,9 @@ class IntegralGoods extends Model
150 */ 150 */
151 public function checkStockNum($goodsId,$number){ 151 public function checkStockNum($goodsId,$number){
152 $sum_stock_num = $this->alias('g') 152 $sum_stock_num = $this->alias('g')
153 - ->join('fa_integral_depot d','g.id=d.goods_id') 153 + ->join('fa_depot d','g.id=d.goods_id')
154 ->where(['g.id' => $goodsId]) 154 ->where(['g.id' => $goodsId])
  155 + ->where('type',2)
155 ->field('d.id,d.stock_num') 156 ->field('d.id,d.stock_num')
156 ->sum('d.stock_num'); 157 ->sum('d.stock_num');
157 if($number > $sum_stock_num){ 158 if($number > $sum_stock_num){