|
@@ -62,6 +62,9 @@ class SyncMjWarehouse extends Command {
|
62
|
62
|
$cost = DB::table('goods_skus')->where('code', $code)->select('referenceCost', 'is_weigh')->first(); //获取规格成本/是否称重
|
63
|
63
|
if($cost){
|
64
|
64
|
$quantity = $cost->is_weigh == 1 ? $sku['quantity']/2 : $sku['quantity']; //对应规格数量
|
|
65
|
+ //实际库存=库存-冻结
|
|
66
|
+ $real_quantity = $sku['quantity'] - $sku['fi'];
|
|
67
|
+ $real_quantity = $cost->is_weigh == 1 ? $real_quantity/2 : $real_quantity; //对应规格数量
|
65
|
68
|
$up['quantity'] = $quantity;
|
66
|
69
|
$up['totalCost'] = isset($sku['totalCost']) ? $sku['totalCost'] : 0;
|
67
|
70
|
if($up['quantity'] != 0 ){
|
|
@@ -72,7 +75,8 @@ class SyncMjWarehouse extends Command {
|
72
|
75
|
$up['outPrice'] = 0;
|
73
|
76
|
}
|
74
|
77
|
$up['cost'] = isset($sku['cost']) ? $sku['cost'] : 0;
|
75
|
|
-
|
|
78
|
+ //实际库存=库存-冻结
|
|
79
|
+ $up['quantity'] = $real_quantity;
|
76
|
80
|
$up_re = DB::table('goods_skus')->where('code', $code)->update($up);
|
77
|
81
|
}
|
78
|
82
|
|