|
@@ -141,52 +141,52 @@ class BoxService extends Service
|
|
|
}
|
|
|
|
|
|
//销售订单包装----------------todo 目前只能按找生产包所以continue
|
|
|
- foreach ($sale_product_list as $v) {continue;
|
|
|
- $box_type = 0;
|
|
|
- if($v['id'] < 0) {
|
|
|
- $v['id'] = -$v['id'];
|
|
|
- $box_type = 1;
|
|
|
- }
|
|
|
- $num_list = $key_list[$v['id']];
|
|
|
- $total = $num_list['total'];
|
|
|
- $detail = $num_list['detail'];
|
|
|
- $team_id = $num_list['team_id'];
|
|
|
- $box_detail = new BoxDetail(['channel'=>$top_order_no]);
|
|
|
- $un_box_num = $v['order_quantity'] - $v['box_num'] - $box_detail->where('top_id',$v['id'])->where('del_time',0)->where('box_type',1)->sum('num');
|
|
|
- if ($total > $un_box_num) return [false, $v['product_title'] . '数量不足'];
|
|
|
-
|
|
|
- $ext_1 = $v['product_no'];//产品编号
|
|
|
- $ext_2 = $v['technology_material']; //工艺材质 废弃
|
|
|
- $ext_3 = $v['technology_name'];//工艺名称 改为颜色
|
|
|
- $ext_4 = $v['wood_name'];//木皮 废弃
|
|
|
- $ext_5 = $v['process_mark'];//工艺备注 废弃
|
|
|
- $ext_8 = $v['product_title'];//产品名称
|
|
|
- $out_order_no = $insert['out_order_no'] = $v['out_order_no'];
|
|
|
- $top_id = $v['id'];
|
|
|
- foreach ($detail as $vv){
|
|
|
- $box_insert[] = [
|
|
|
- 'out_order_no' => $out_order_no,
|
|
|
- 'top_id' => $top_id,
|
|
|
- 'orders_product_id' => 0,
|
|
|
- 'ext_1' => $ext_1,
|
|
|
- 'ext_2' => $ext_2,
|
|
|
- 'ext_3' => $ext_3,
|
|
|
- 'ext_4' => $ext_4,
|
|
|
- 'ext_5' => $ext_5,
|
|
|
- 'ext_8' => $ext_8,
|
|
|
- 'num' => $vv,
|
|
|
- 'price' => $v['price'],
|
|
|
- 'box_type' => $box_type,
|
|
|
- 'team_id' => $team_id,
|
|
|
- 'shipment_order_no' => $transport_no,
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- //修改销售订单 包装数量
|
|
|
- SaleOrdersProduct::where('id',$v['id'])->update([
|
|
|
- 'box_num' => DB::raw('box_num + '.$total),
|
|
|
- ]);
|
|
|
- }
|
|
|
+// foreach ($sale_product_list as $v) {continue;
|
|
|
+// $box_type = 0;
|
|
|
+// if($v['id'] < 0) {
|
|
|
+// $v['id'] = -$v['id'];
|
|
|
+// $box_type = 1;
|
|
|
+// }
|
|
|
+// $num_list = $key_list[$v['id']];
|
|
|
+// $total = $num_list['total'];
|
|
|
+// $detail = $num_list['detail'];
|
|
|
+// $team_id = $num_list['team_id'];
|
|
|
+// $box_detail = new BoxDetail(['channel'=>$top_order_no]);
|
|
|
+// $un_box_num = $v['order_quantity'] - $v['box_num'] - $box_detail->where('top_id',$v['id'])->where('del_time',0)->where('box_type',1)->sum('num');
|
|
|
+// if ($total > $un_box_num) return [false, $v['product_title'] . '数量不足'];
|
|
|
+//
|
|
|
+// $ext_1 = $v['product_no'];//产品编号
|
|
|
+// $ext_2 = $v['technology_material']; //工艺材质 废弃
|
|
|
+// $ext_3 = $v['technology_name'];//工艺名称 改为颜色
|
|
|
+// $ext_4 = $v['wood_name'];//木皮 废弃
|
|
|
+// $ext_5 = $v['process_mark'];//工艺备注 废弃
|
|
|
+// $ext_8 = $v['product_title'];//产品名称
|
|
|
+// $out_order_no = $insert['out_order_no'] = $v['out_order_no'];
|
|
|
+// $top_id = $v['id'];
|
|
|
+// foreach ($detail as $vv){
|
|
|
+// $box_insert[] = [
|
|
|
+// 'out_order_no' => $out_order_no,
|
|
|
+// 'top_id' => $top_id,
|
|
|
+// 'orders_product_id' => 0,
|
|
|
+// 'ext_1' => $ext_1,
|
|
|
+// 'ext_2' => $ext_2,
|
|
|
+// 'ext_3' => $ext_3,
|
|
|
+// 'ext_4' => $ext_4,
|
|
|
+// 'ext_5' => $ext_5,
|
|
|
+// 'ext_8' => $ext_8,
|
|
|
+// 'num' => $vv,
|
|
|
+// 'price' => $v['price'],
|
|
|
+// 'box_type' => $box_type,
|
|
|
+// 'team_id' => $team_id,
|
|
|
+// 'shipment_order_no' => $transport_no,
|
|
|
+// ];
|
|
|
+// }
|
|
|
+//
|
|
|
+// //修改销售订单 包装数量
|
|
|
+// SaleOrdersProduct::where('id',$v['id'])->update([
|
|
|
+// 'box_num' => DB::raw('box_num + '.$total),
|
|
|
+// ]);
|
|
|
+// }
|
|
|
|
|
|
//客户名称
|
|
|
$ext_1 = "";
|