作者 耿培杰

修改订单付款接口

... ... @@ -209,15 +209,6 @@ class Goods extends Model
*/
public function getDepot($goodsId,$areaId,$number,$type){
$arr = [];//仓库对应需扣除库存信息
//获取全部仓库库存
$depotModel = new Depot();
$sum_stock_num = $depotModel
->where(['goods_id' => $goodsId])
->where('type',"'".$type."'")
->sum('stock_num');
if($number > $sum_stock_num){
return false; //库存不足
}
//获取当前省仓库库存
$province_depot = $this->alias('g')
->join('fa_depot d','g.id=d.goods_id')
... ...
... ... @@ -94,15 +94,6 @@ class IntegralGoods extends Model
*/
public function getDepot($goodsId,$areaId,$number){
$arr = [];//仓库对应需扣除库存信息
//获取全部仓库库存
$sum_stock_num = $this->alias('g')
->join('fa_integral_depot d','g.id=d.goods_id')
->where(['g.id' => $goodsId])
->field('d.id,d.stock_num')
->sum('d.stock_num');
if($number > $sum_stock_num){
return false; //库存不足
}
//获取当前省仓库库存
$province_depot = $this->alias('g')
->join('fa_integral_depot d','g.id=d.goods_id')
... ...