...
|
...
|
@@ -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')
|
...
|
...
|
|