wugg 1 jaar geleden
bovenliggende
commit
7978387814
2 gewijzigde bestanden met toevoegingen van 17 en 4 verwijderingen
  1. 1 1
      app/admin/controller/After.php
  2. 16 3
      app/admin/controller/OrderOutChild.php

+ 1 - 1
app/admin/controller/After.php

@@ -288,7 +288,7 @@ class After extends Base
                     ->name('supplier')
                     ->where(['is_del' => 0, 'personid' => $arr])
                     ->column('code');
-                $where[] = ["a.supplierNo", "in", $supplierNos];//这个地方不应该使用condition,应该使用where与其他条件并列
+                $condition[] = ["a.supplierNo", "in", $supplierNos];//这个地方不应该使用condition,应该使用where与其他条件并列
             }
         }
 

+ 16 - 3
app/admin/controller/OrderOutChild.php

@@ -409,7 +409,7 @@ class OrderOutChild extends Base
 
         $order_out = Db::name('order_out')
             ->where(['is_del' => 0, 'outCode' => array_unique(array_column($child, 'outCode'))])
-            ->column('id,send_num,send_status,0 already_send_num,status,apply_id', 'outCode');
+            ->column('id,send_num,send_status,0 already_send_num,post_name,post_code,post_fee,status,apply_id', 'outCode');
 
         $sale = Db::name('sale')
             ->where(['is_del' => 0, 'orderCode' => array_unique(array_column($child, 'orderCode'))])
@@ -516,12 +516,25 @@ class OrderOutChild extends Base
                 ]);
 
                 $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] += $child[$value['outChildCode']]['num'];
-
+                $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] += $child[$value['outChildCode']]['num'];
+                $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] += $child[$value['outChildCode']]['num'];
+				if($order_out[$child[$value['outChildCode']]['outCode']]['post_name']==''||$order_out[$child[$value['outChildCode']]['outCode']]['post_code']=='' ){
+					$order_out[$child[$value['outChildCode']]['outCode']]['post_name']=  $value['post_name'];
+					$order_out[$child[$value['outChildCode']]['outCode']]['post_code']=  $value['post_code'];
+					$order_out[$child[$value['outChildCode']]['outCode']]['post_fee']=  $value['post_fee'];
+				}
                 //发货单
                 //send_status 3部分发货,4全部发货
                 Db::name('order_out')
                     ->where(['id' => $order_out[$child[$value['outChildCode']]['outCode']]['id']])
-                    ->update(['send_status' => $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] >= $order_out[$child[$value['outChildCode']]['outCode']]['send_num'] ? 4 : 3, 'status' => 2, 'updatetime' => $date]);
+                    ->update([
+                    	'send_status' => $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] >= $order_out[$child[$value['outChildCode']]['outCode']]['send_num'] ? 4 : 3,
+                    	'status' => 2,
+                    	'post_name' => $order_out[$child[$value['outChildCode']]['outCode']]['post_name'],
+                        'post_code' => $order_out[$child[$value['outChildCode']]['outCode']]['post_code'],
+                        'post_fee' => $order_out[$child[$value['outChildCode']]['outCode']]['post_fee'],
+                    	'updatetime' => $date
+                    	 ]);
 
                 $sale[$child[$value['outChildCode']]['orderCode']]['send_num'] += $child[$value['outChildCode']]['num'];
                 $sale[$child[$value['outChildCode']]['orderCode']]['wsend_num'] -= $child[$value['outChildCode']]['num'];