|
@@ -765,10 +765,17 @@ class FxOrderController extends Controller
|
765
|
765
|
|
766
|
766
|
$skus = array_keys($order_skus);
|
767
|
767
|
if(!empty($skus)){
|
768
|
|
- $goods = Goods::select('gs.id as sku_id', 'goods.id as goods_id', 'goods.name', 'gs.propsName as props_name', 'gs.price', 'gs.is_weigh')->leftJoin('goods_skus as gs', 'gs.goodsCode', '=', 'goods.id')->whereIn('gs.id', $skus)->orderBy('goods.id', 'desc')->get();
|
|
768
|
+ $goods = Goods::select('gs.id as sku_id', 'goods.id as goods_id', 'goods.name', 'gs.propsName as props_name', 'gs.price', 'gs.is_weigh', 'gs.is_white', 'gs.quantity')->leftJoin('goods_skus as gs', 'gs.goodsCode', '=', 'goods.id')->whereIn('gs.id', $skus)->orderBy('goods.id', 'desc')->get();
|
769
|
769
|
$goods = json_decode(json_encode($goods),true);
|
770
|
770
|
foreach($goods as $k=>&$v){
|
771
|
771
|
$v['num'] = $order_skus[$v['sku_id']];
|
|
772
|
+ //计算实际库存 -还未到卖家云的量
|
|
773
|
+ $v['quantity'] = GoodsSkus::actualQuantity($v['sku_id']);
|
|
774
|
+ $v['quantity'] = $v['quantity'] + $v['num'];
|
|
775
|
+ $v['quantity_str'] = $v['quantity'];
|
|
776
|
+ if($v['is_white'] == 1){
|
|
777
|
+ $v['quantity_str'] = '虚拟库存';
|
|
778
|
+ }
|
772
|
779
|
}
|
773
|
780
|
$order['goods'] = $goods;
|
774
|
781
|
}
|
|
@@ -1120,6 +1127,11 @@ class FxOrderController extends Controller
|
1120
|
1127
|
CustomerInfo::where('phone', $consum->phone)->update(['balance'=>$balance]);
|
1121
|
1128
|
}
|
1122
|
1129
|
|
|
1130
|
+ #更新order_goods_skus状态
|
|
1131
|
+ $mj_status = array();
|
|
1132
|
+ $mj_status['mj_status'] = 2;
|
|
1133
|
+ FxOrderGoodsSkus::where('order_id', $id)->where('is_del', 0)->update($mj_status);
|
|
1134
|
+
|
1123
|
1135
|
#记录操作日志
|
1124
|
1136
|
$self_id = session('admin_id');
|
1125
|
1137
|
$self_name = session('real_name');
|
|
@@ -1174,6 +1186,12 @@ class FxOrderController extends Controller
|
1174
|
1186
|
throw new Exception("订单同步到卖家云失败");
|
1175
|
1187
|
}
|
1176
|
1188
|
}
|
|
1189
|
+
|
|
1190
|
+ #更新order_goods_skus状态,退回库存
|
|
1191
|
+ $mj_status = array();
|
|
1192
|
+ $mj_status['mj_status'] = 2;
|
|
1193
|
+ FxOrderGoodsSkus::where('order_id', $id)->where('is_del', 0)->update($mj_status);
|
|
1194
|
+
|
1177
|
1195
|
#记录操作日志
|
1178
|
1196
|
$self_id = session('admin_id');
|
1179
|
1197
|
$self_name = session('real_name');
|
|
@@ -1257,6 +1275,11 @@ class FxOrderController extends Controller
|
1257
|
1275
|
if( $syncMj == false ){
|
1258
|
1276
|
throw new Exception("订单同步到卖家云失败");
|
1259
|
1277
|
}
|
|
1278
|
+
|
|
1279
|
+ #同步到卖家云,更新order_goods_skus状态
|
|
1280
|
+ $mj_status = array();
|
|
1281
|
+ $mj_status['mj_status'] = 1;
|
|
1282
|
+ FxOrderGoodsSkus::where('order_id', $id)->where('is_del', 0)->update($mj_status);
|
1260
|
1283
|
}
|
1261
|
1284
|
}
|
1262
|
1285
|
|