作者 耿培杰

修改订单付款接口

... ... @@ -280,6 +280,7 @@ class Goods extends Model
$sum_stock_num = $this->alias('g')
->join('fa_depot d','g.id=d.goods_id')
->where(['g.id' => $goodsId])
->where('type',1)
->field('d.id,d.stock_num')
->sum('d.stock_num');
if($number > $sum_stock_num){
... ...
... ... @@ -150,8 +150,9 @@ class IntegralGoods extends Model
*/
public function checkStockNum($goodsId,$number){
$sum_stock_num = $this->alias('g')
->join('fa_integral_depot d','g.id=d.goods_id')
->join('fa_depot d','g.id=d.goods_id')
->where(['g.id' => $goodsId])
->where('type',2)
->field('d.id,d.stock_num')
->sum('d.stock_num');
if($number > $sum_stock_num){
... ...