|
@@ -20,7 +20,7 @@ class GoodStock extends Model
|
|
|
//组合商品占用 库存 0 库存返回 1 库存占用
|
|
|
public function stockSub($spuCode,$num,$flag =1){
|
|
|
$row =$this->withJoin(['wsminfo'],'left')
|
|
|
- ->field('id,usable_stock')
|
|
|
+ ->field('good_stock.id,usable_stock')
|
|
|
->where(['spuCode' => $spuCode, 'warehouse_info.wsm_type'=>[2,5]])
|
|
|
->findOrEmpty();
|
|
|
if($row->isEmpty()) throw new \Exception('未找到对应子商品库存信息');
|