Selaa lähdekoodia

周末临时线上修改

longyi 5 kuukautta sitten
vanhempi
commit
27059f6fa6

+ 138 - 49
core/CoreApp/controllers/Systembound.php

@@ -11,6 +11,7 @@ class Systembound extends Start_Controller {
 		$this->load->_model('Model_warehouse','warehouse');
 		$this->load->_model('Model_fullorder','fullorder');
 		$this->load->_model('Model_fullordertt','fullordertt');
+		$this->load->_model('Model_fullorderamz','fullorderamz');
 		$this->load->_model('Model_fullordersmt','fullordersmt');
 		$this->load->_model('Model_fullorderxw','fullorderxw');
 	}
@@ -296,19 +297,34 @@ class Systembound extends Start_Controller {
 				    	}
 						else
 						{
-							$yd = $this->fullorderxw->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
-							if(isset($yd[0]['number']))
-				    		{
-					    		$number = $yd[0]['number'];
-								if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
-								{
-									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
-								}
-				    		}
-							else
-							{
-								echo json_encode(array('msg'=>'系统中未查到此运单,请确认!'.$number,'success'=>false));exit;
-							}
+						    $yd = $this->fullorderamz->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    						if(isset($yd[0]['number']))
+    				    	{
+    					    	$number = $yd[0]['number'];
+    							if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
+    							{
+    								echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    							}
+    				    	}
+    						else
+    						{
+    						    $yd = $this->fullorderxw->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    							if(isset($yd[0]['number']))
+    				    		{
+    					    		$number = $yd[0]['number'];
+    								if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
+    								{
+    									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    								}
+    				    		}
+    							else
+    							{
+    								echo json_encode(array('msg'=>'系统中未查到此运单,请确认!'.$number,'success'=>false));exit;
+    							}
+    						}
+						    
+    						    
+    							
 						}
 					}
 				}
@@ -367,19 +383,37 @@ class Systembound extends Start_Controller {
 				    	}
 						else
 						{
-							$dd = $this->fullorderxw->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
-							if(isset($dd[0]['number']))
-				    		{
-					    		$number = $dd[0]['number'];
-								if($dd[0]['express'] != $express)
-								{
-									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
-								}
-				    		}
-							else
-							{
-								echo json_encode(array('msg'=>'系统中未查到此编号,请确认!','success'=>false));exit;
-							}
+						    
+						    
+						    $dd = $this->fullorderamz->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    						if(isset($dd[0]['number']))
+    				    	{
+    					    	$number = $dd[0]['number'];
+    							if($dd[0]['express'] != $express)
+    							{
+    								echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    							}
+    				    	}
+    						else
+    						{
+    						    $dd = $this->fullorderxw->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    							if(isset($dd[0]['number']))
+    				    		{
+    					    		$number = $dd[0]['number'];
+    								if($dd[0]['express'] != $express)
+    								{
+    									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    								}
+    				    		}
+    							else
+    							{
+    								echo json_encode(array('msg'=>'系统中未查到此编号,请确认!','success'=>false));exit;
+    							}
+    						}
+						    
+						    
+						    
+							
 						}
 					}
 				}
@@ -779,23 +813,42 @@ class Systembound extends Start_Controller {
 				    	}
 						else
 						{
-							$yd = $this->fullorderxw->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
-							if(isset($yd[0]['number']))
-				    		{
-					   		 $number = $yd[0]['number'];
-								if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
-								{
-									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
-								}
-								if($yd[0]['express'] != 24 && $yd[0]['express'] == 31)
-								{
-									echo json_encode(array('msg'=>'请选择杭州联邦快递方式录入','success'=>false));exit;
-								}
-				    		}
-							else
-							{
-								echo json_encode(array('msg'=>'系统中未查到此运单,请确认!'.$number,'success'=>false));exit;
-							}
+						    $yd = $this->fullorderamz->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    						if(isset($yd[0]['number']))
+    				    	{
+    					   	 $number = $yd[0]['number'];
+    							if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
+    							{
+    								echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    							}
+    							if($yd[0]['express'] != 24 && $yd[0]['express'] == 31)
+    							{
+    								echo json_encode(array('msg'=>'请选择杭州联邦快递方式录入','success'=>false));exit;
+    							}
+    				    	}
+    						else
+    						{
+    						    	$yd = $this->fullorderxw->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+        							if(isset($yd[0]['number']))
+        				    		{
+        					   		 $number = $yd[0]['number'];
+        								if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
+        								{
+        									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+        								}
+        								if($yd[0]['express'] != 24 && $yd[0]['express'] == 31)
+        								{
+        									echo json_encode(array('msg'=>'请选择杭州联邦快递方式录入','success'=>false));exit;
+        								}
+        				    		}
+        							else
+        							{
+        								echo json_encode(array('msg'=>'系统中未查到此运单,请确认!'.$number,'success'=>false));exit;
+        							}
+    						}
+						    
+						    
+						
 						}
 					}
 				}
@@ -854,7 +907,7 @@ class Systembound extends Start_Controller {
 				    	}
 						else
 						{
-							$dd = $this->fullordertt->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+							$dd = $this->fullorderamz->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
 							if(isset($dd[0]['number']))
 				    		{
 					    		$number = $dd[0]['number'];
@@ -865,7 +918,19 @@ class Systembound extends Start_Controller {
 				    		}
 							else
 							{
-								echo json_encode(array('msg'=>'系统中未查到此编号,请确认!','success'=>false));exit;
+									$dd = $this->fullorderxw->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+        							if(isset($dd[0]['number']))
+        				    		{
+        					    		$number = $dd[0]['number'];
+        								if($dd[0]['express'] != $express)
+        								{
+        									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+        								}
+        				    		}
+        							else
+        							{
+        								echo json_encode(array('msg'=>'系统中未查到此编号,请确认!','success'=>false));exit;
+        							}
 							}
 						}
 					}
@@ -1047,7 +1112,7 @@ class Systembound extends Start_Controller {
 				    	}
 						else
 						{
-							$yd = $this->fullorderxw->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+							$yd = $this->fullorderamz->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
 							if(isset($yd[0]['number']))
 				    		{
 					    		$number = $yd[0]['number'];
@@ -1058,7 +1123,19 @@ class Systembound extends Start_Controller {
 				    		}
 							else
 							{
-								echo json_encode(array('msg'=>'系统中未查到此运单,请确认!'.$number,'success'=>false));exit;
+								$yd = $this->fullorderxw->find_all("waybill = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    							if(isset($yd[0]['number']))
+    				    		{
+    					    		$number = $yd[0]['number'];
+    								if($yd[0]['express'] != $express && $yd[0]['express'] != 31)
+    								{
+    									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    								}
+    				    		}
+    							else
+    							{
+    								echo json_encode(array('msg'=>'系统中未查到此运单,请确认!'.$number,'success'=>false));exit;
+    							}
 							}
 						}
 					}
@@ -1126,7 +1203,7 @@ class Systembound extends Start_Controller {
 				    	}
 						else
 						{
-							$dd = $this->fullorderxw->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+							$dd = $this->fullorderamz->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
 							if(isset($dd[0]['number']))
 				    		{
 					    		$number = $dd[0]['number'];
@@ -1137,7 +1214,19 @@ class Systembound extends Start_Controller {
 				    		}
 							else
 							{
-								echo json_encode(array('msg'=>'系统中未查到此编号,请确认!','success'=>false));exit;
+								$dd = $this->fullorderxw->find_all("number = '$number' and library = '2' and librarytime > '".(time()-30*24*3600)."'");
+    							if(isset($dd[0]['number']))
+    				    		{
+    					    		$number = $dd[0]['number'];
+    								if($dd[0]['express'] != $express)
+    								{
+    									echo json_encode(array('msg'=>'录入信息和选择快递不一致!','success'=>false));exit;
+    								}
+    				    		}
+    							else
+    							{
+    								echo json_encode(array('msg'=>'系统中未查到此编号,请确认!','success'=>false));exit;
+    							}
 							}
 						}
 					}

+ 287 - 16
core/CoreApp/controllers/Systemfout.php

@@ -10,6 +10,7 @@ class Systemfout extends Start_Controller {
 		$this->load->_model('Model_excel','excel');
 		$this->load->_model('Model_fullorder','fullorder');
 		$this->load->_model('Model_fullordertt','fullordertt');
+		$this->load->_model('Model_fullorderamz','fullorderamz');
 		$this->load->_model('Model_fullordersmt','fullordersmt');
 		$this->load->_model('Model_outbound','outbound');
 		$this->load->_model('Model_express','express');
@@ -243,6 +244,7 @@ class Systemfout extends Start_Controller {
 				}
 				$info_list[$key]['shipremarks'] = str_replace(array('<','>'),array('&lt;','&gt;'),$value['shipremarks']);
             }
+            
 			$info_listtt = $this->fullordertt->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
 			 //格式化数据
             foreach ($info_listtt as $key=>$value) 
@@ -290,6 +292,56 @@ class Systemfout extends Start_Controller {
 					$info_listtt[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
 				}
             }
+            
+            $info_listamz = $this->fullorderamz->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				$shop = $this->shop->read($value['shop']);
+				$info_listamz[$key]['shop'] = $shop['shopname'];
+				if($value['waybill'] == '0')
+				{
+					$info_listamz[$key]['waybill'] = "";
+				}
+				$express = $this->express->read($value['express']);
+				$info_listamz[$key]['express'] = $express['servicename'];
+				$warehouse = $this->warehouse->read($value['type']);
+				$info_listamz[$key]['type'] = $warehouse['title'];
+				if($value['print'] == 1)
+				{
+					$info_listamz[$key]['print'] = '不可打印';
+				}
+				else if($value['print'] == 2)
+				{
+					$info_listamz[$key]['print'] = '未打印';
+				}
+				else if($value['print'] == 3)
+				{
+					$info_listamz[$key]['print'] = '已打印';
+				}
+				if($value['library'] == 1)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">未出库</em>';
+				}
+				else if($value['library'] == 2)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已出库</em>';
+				}
+				else if($value['library'] == 3)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已退库</em>';
+				}
+				if($value['librarytime'] == '0')
+				{
+					$info_listamz[$key]['librarytime'] = '<em class="t"></em>';
+				}
+				else
+				{
+					$info_listamz[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
+				}
+            }
+            
+            
 			$info_listxw = $this->fullorderxw->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
 			 //格式化数据
             foreach ($info_listxw as $key=>$value) 
@@ -386,11 +438,12 @@ class Systemfout extends Start_Controller {
             }
 		    $total = $this->fullorder->find_count($where);
 			$total += $this->fullordertt->find_count($where);
+			$total += $this->fullorderamz->find_count($where);
 			$total += $this->fullorderxw->find_count($where);
 			$total += $this->fullordersmt->find_count($where);
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
-		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listtt,$info_listxw,$info_listsmt)));
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listamz,$info_listtt,$info_listxw,$info_listsmt)));
 		    echo json_encode($rows);exit;
 		}
 		if(isset($_SESSION['api']))
@@ -455,17 +508,33 @@ class Systemfout extends Start_Controller {
 								$outtype = 2;
 								if(!$y)
 				        			{
-										$fullorder_name = 'fullorderxw';$outtype = 1;
-										$y = $this->fullorderxw->get_waybill($order);
-										if(!$y)
-				    					{
-											$y = $this->fullorderxw->get_number($order);
-											$outtype = 2;
-											if(!$y)
-				        					{
-												echo json_encode(array('msg'=>'无此数据','success'=>false));exit;
-											}
-										}
+				        			    $fullorder_name = 'fullorderamz';$outtype = 1;
+            							$y = $this->fullorderamz->get_waybill($order);
+            							if(!$y)
+            				    		{
+            				    		    $y = $this->fullorderamz->get_number($order);
+								            $outtype = 2;
+								            if(!$y){
+								                
+								                $fullorder_name = 'fullorderxw';$outtype = 1;
+            										$y = $this->fullorderxw->get_waybill($order);
+            										if(!$y)
+            				    					{
+            											$y = $this->fullorderxw->get_number($order);
+            											$outtype = 2;
+            											if(!$y)
+            				        					{
+            												echo json_encode(array('msg'=>'无此数据','success'=>false));exit;
+            											}
+            										}
+								            }
+            				    		}
+										
+										
+										
+										
+										
+										
 									}
 							}
 						}
@@ -761,7 +830,7 @@ class Systemfout extends Start_Controller {
         	    }
 				**/
 			}
-			else if(($fullorder_name == 'fullordertt' || $fullorder_name == 'fullorderxw' || $fullorder_name == 'fullorder') && $y['source'] == 1)
+			else if(($fullorder_name == 'fullordertt' || $fullorder_name == 'fullorderxw' || $fullorder_name == 'fullorder' || $fullorder_name = 'fullorderamz') && $y['source'] == 1)
 			{
 				/**
 				if($this->$fullorder_name->save(array('library'=>2,'librarytime'=>$time,'weight'=>$weight),$y['id']))
@@ -1693,6 +1762,138 @@ class Systemfout extends Start_Controller {
             }
 			
 			
+				 //取得信息列表
+            $info_listamz = $this->fullorderamz->find_all($where.$wid,'shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks,ts,fpdata',$order_str);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				$shop = $this->shop->read($value['shop']);
+				$info_listamz[$key]['shop'] = $shop['shopname'];
+				if($value['waybill'] == '0')
+				{
+					$info_listamz[$key]['waybill'] = "";
+				}
+				$express = $this->express->read($value['express']);
+				$info_listamz[$key]['express'] = $express['servicename'];
+				$warehouse = $this->warehouse->read($value['type']);
+				$info_listamz[$key]['type'] = $warehouse['title'];
+				if($value['print'] == 1)
+				{
+					$info_listamz[$key]['print'] = '不可打印';
+				}
+				else if($value['print'] == 2)
+				{
+					$info_listamz[$key]['print'] = '未打印';
+				}
+				else if($value['print'] == 3)
+				{
+					$info_listamz[$key]['print'] = '已打印';
+				}
+				if($value['library'] == 1)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">未出库</em>';
+				}
+				else if($value['library'] == 2)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已出库</em>';
+				}
+				else if($value['library'] == 3)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已退库</em>';
+				}
+				if($value['librarytime'] == '0')
+				{
+					$info_listamz[$key]['librarytime'] = '<em class="t"></em>';
+				}
+				else
+				{
+					$info_listamz[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
+				}
+				$classid = $classid = $this->classid->sku();
+				$dbapi = explode(';',trim($value['fpdata'],';'));
+					foreach ($dbapi as $va) 
+					{
+						$pm = $classid;
+		    			$jm = $classid;
+						$bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>'');
+						$features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$va);
+						$ts = explode('|',trim($features,'|'));
+						if(stripos($ts[0],',') !== false)
+						{
+							$ft = explode(',',$ts[0]);
+			    			$features = explode('-',trim($ft[1],'-'));
+							$features[] = $ft[0];
+						}
+						else
+						{
+							$features = explode('-',trim($ts[0],'-'));
+						}
+						foreach($features as $k=>$v)
+						{
+							if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
+							{
+								if($typeclass[$v]['bm'] != '')
+								{
+									$bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
+								}
+							}
+							if($v != 0 && isset($typeclass[$v]))
+							{
+								if($typeclass[$v]['classid'] == 13)
+								{
+									$dj = $typeclass[$v]['title'];
+								}
+								if($typeclass[$v]['classid'] == 8)
+								{
+									$ys = $typeclass[$v]['title'];
+								}
+								if($typeclass[$v]['classid'] == 15)
+								{
+									$hx = $typeclass[$v]['title'];
+								}
+								if(isset($pm[$typeclass[$v]['classid']]))
+								{
+									if($typeclass[$v]['title'] == '9A')
+									{
+										$pm[$typeclass[$v]['classid']] = '9A';
+									}
+									else if($typeclass[$v]['title'] == '10A')
+									{
+										$pm[$typeclass[$v]['classid']] = '10A';
+									}
+									else
+									{
+										$clzh = $typeclass[$v]['zh'];
+										if(stripos($typeclass[$v]['zh'],'|') !== false)
+										{
+											$clzh = explode('|',rtrim($typeclass[$v]['zh'],'|'));
+											$clzh = $clzh[0];
+										}
+										$pm[$typeclass[$v]['classid']] = $clzh;
+									}
+								}
+								if(isset($jm[$typeclass[$v]['classid']]))
+								{
+									if($typeclass[$v]['jm'])
+									{
+						    			$jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
+									}
+								}
+							}
+						}
+						$jm = array_filter($jm);//去除空值
+						$jm = implode("-",$jm);
+						$pm = array_filter($pm);//去除空值
+						$zh = implode(" ",$pm);
+						$zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' '));
+					}
+					$info_listamz[$key]['jm'] = $jm;
+					$info_listamz[$key]['zh'] = $zh;
+            }
+			
+			
+			
+			
 			 //取得信息列表
             $info_listxw = $this->fullorderxw->find_all($where.$wid,'shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks,ts,fpdata',$order_str);
 			 //格式化数据
@@ -1825,7 +2026,7 @@ class Systemfout extends Start_Controller {
             $titlename = "<table border=1>".$t."<td>条数</td><td>料品</td><td>品名</td></table>";
 			$tail = "\n";
             $filename = $title.".xls";
-            $this->excel->get_fz2(array_merge($info_list,$info_listtt,$info_listxw,$info_listsmt),$titlename,$filename,$tail);
+            $this->excel->get_fz2(array_merge($info_list,$info_listtt,$info_listamz,$info_listxw,$info_listsmt),$titlename,$filename,$tail);
 		}
 	}
 	
@@ -2683,6 +2884,22 @@ class Systemfout extends Start_Controller {
 				$info_listtt[$key]['type'] = $warehouse['title'];
 				$info_listtt[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
             }
+            
+            
+            $info_listamz = $this->fullorderamz->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				$shop = $this->shop->read($value['shop']);
+				$info_listamz[$key]['shop'] = $shop['shopname'];
+				$express = $this->express->read($value['express']);
+				$info_listamz[$key]['express'] = $express['servicename'];
+				$warehouse = $this->warehouse->read($value['type']);
+				$info_listamz[$key]['type'] = $warehouse['title'];
+				$info_listamz[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
+            }
+            
+            
 			$info_listxw = $this->fullorderxw->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
 			 //格式化数据
             foreach ($info_listxw as $key=>$value) 
@@ -2709,11 +2926,12 @@ class Systemfout extends Start_Controller {
             }
 		    $total = $this->fullorder->find_count($where);
 			$total += $this->fullordertt->find_count($where);
+			$total += $this->fullorderamz->find_count($where);
 			$total += $this->fullorderxw->find_count($where);
 			$total += $this->fullordersmt->find_count($where);
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
-		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listtt,$info_listxw,$info_listsmt)));
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listamz,$info_listtt,$info_listxw,$info_listsmt)));
 		    echo json_encode($rows);exit;
 		}
 		if(isset($_SESSION['api']))
@@ -2930,6 +3148,58 @@ class Systemfout extends Start_Controller {
 					$info_listtt[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
 				}
             }
+            
+            
+            $info_listamz = $this->fullorderamz->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,orderremarks',$order_str,$start,$perpage);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				$shop = $this->shop->read($value['shop']);
+				$info_listamz[$key]['shop'] = $shop['shopname'];
+				if($value['waybill'] == '0')
+				{
+					$info_listamz[$key]['waybill'] = "";
+				}
+				$express = $this->express->read($value['express']);
+				$info_listamz[$key]['express'] = $express['servicename'];
+				$warehouse = $this->warehouse->read($value['type']);
+				$info_listamz[$key]['type'] = $warehouse['title'];
+				if($value['print'] == 1)
+				{
+					$info_listamz[$key]['print'] = '不可打印';
+				}
+				else if($value['print'] == 2)
+				{
+					$info_listamz[$key]['print'] = '未打印';
+				}
+				else if($value['print'] == 3)
+				{
+					$info_listamz[$key]['print'] = '已打印';
+				}
+				if($value['library'] == 1)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">未出库</em>';
+				}
+				else if($value['library'] == 2)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已出库</em>';
+				}
+				else if($value['library'] == 3)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已退库</em>';
+				}
+				if($value['librarytime'] == '0')
+				{
+					$info_listamz[$key]['librarytime'] = '<em class="t"></em>';
+				}
+				else
+				{
+					$info_listamz[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
+				}
+            }
+            
+            
+            
 			$info_listxw = $this->fullorderxw->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,orderremarks',$order_str,$start,$perpage);
 			 //格式化数据
             foreach ($info_listxw as $key=>$value) 
@@ -3026,11 +3296,12 @@ class Systemfout extends Start_Controller {
             }
 		    $total = $this->fullorder->find_count($where);
 			$total += $this->fullordertt->find_count($where);
+			$total += $this->fullorderamz->find_count($where);
 			$total += $this->fullorderxw->find_count($where);
 			$total += $this->fullordersmt->find_count($where);
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
-		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listtt,$info_listxw,$info_listsmt)));
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listtt,$info_listamz,$info_listxw,$info_listsmt)));
 		    echo json_encode($rows);exit;
 		}
 		if(isset($_SESSION['api']))

+ 145 - 5
core/CoreApp/controllers/Systemprint.php

@@ -12,6 +12,7 @@ class Systemprint extends Start_Controller {
 		$this->load->_model('Model_fullorder_smt','fullorder_smt');
 		$this->load->_model('Model_fullordersmt','fullordersmt');
 		$this->load->_model('Model_fullordertt','fullordertt');
+		$this->load->_model('Model_fullorderamz','fullorderamz');
 		$this->load->_model('Model_outbound','outbound');
 		$this->load->_model('Model_express','express');
 		$this->load->_model('Model_shop','shop');
@@ -235,6 +236,27 @@ class Systemprint extends Start_Controller {
 				$info_list[$key]['shop'] = $shop['shopname'];
             }
 			    $tt = $this->fullordertt->find_count($where);
+			    
+			    
+			     $info_listamz = $this->fullorderamz->find_all($where,'id,shop,orderinfo,number,shipremarks',$order_str,$start,$perpage);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				$w = $this->fullorderamz->read($value['id']);
+				if(stripos($w['issku'],'#pack') !== false)
+				{
+					unset($info_list[$key]);
+					continue;
+				}
+				$info_list[$key]['id'] = $value['id'].'-fullorderamz';
+				$shop = $this->shop->read($value['shop']);
+				$info_list[$key]['shop'] = $shop['shopname'];
+            }
+			    $amz = $this->fullorderamz->find_count($where);
+			    
+			    
+			    
+			    
 			 $info_listxw = $this->fullorderxw->find_all($where,'id,shop,orderinfo,number,shipremarks',$order_str,$start,$perpage);
 			 //格式化数据
             foreach ($info_listxw as $key=>$value) 
@@ -266,8 +288,8 @@ class Systemprint extends Start_Controller {
             }
 			    $smt += $this->fullordersmt->find_count($where);
 			//$total += $this->fullorder_smt->find_count($where);
-			$total = $dlz+$smt+$tt+$xw;
-			$rows = array_merge($info_list,$info_listtt,$info_listxw,$info_listsmt);
+			$total = $dlz+$smt+$tt+$xw+$amz;
+			$rows = array_merge($info_list,$info_listtt,$info_listamz,$info_listxw,$info_listsmt);
 			//$rows = array_slice($rows,$start,$perpage);
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
@@ -545,6 +567,65 @@ class Systemprint extends Start_Controller {
 				$info_listtt[$key]['shipremarks'] = str_replace(array('<','>'),array('&lt;','&gt;'),$value['shipremarks']);
             }
 			    $tt = $this->fullordertt->find_count($where);
+			    
+			    
+			    
+//取得信息列表
+            $info_listamz = $this->fullorderamz->find_all($where,'id,shop,orderinfo,number,express,waybill,print,printtype,printnumber,printtime,shipremarks',$order_str,$start,$perpage);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				
+				$info_listamz[$key]['id'] = $value['id'].'-fullorderamz';
+				$shop = $this->shop->read($value['shop']);
+				$info_listamz[$key]['shop'] = $shop['shopname'];
+				$express = $this->express->read($value['express']);
+				if($express)
+				{
+				    $info_listamz[$key]['express'] = $express['servicename'];
+				}
+				else
+				{
+					$info_listamz[$key]['express'] = '未选择';
+				}
+				if($value['printtime'] != 0)
+				{
+				    $info_listamz[$key]['printtime'] = date('Y-m-d H:i',$value['printtime']);
+				}
+				else
+				{
+					$info_listamz[$key]['printtime'] = '无';
+				}
+				if($value['print'] == 1)
+				{
+					$info_listamz[$key]['print'] = "禁止打印";
+				}
+				else if($value['print'] == 2)
+				{
+					$info_listamz[$key]['print'] = "未打印";
+				}
+				else if($value['print'] == 3)
+				{
+					$info_listamz[$key]['print'] = "已打印";
+				}
+				if($value['printtype'] == 1)
+				{
+					$info_listamz[$key]['printtype'] = "运单";
+				}
+				else if($value['printtype'] == 2)
+				{
+					$info_listamz[$key]['printtype'] = "发货单";
+				}
+				else if($value['printtype'] == 0)
+				{
+					$info_listamz[$key]['printtype'] = "未选择";
+				}
+				$info_listamz[$key]['shipremarks'] = str_replace(array('<','>'),array('&lt;','&gt;'),$value['shipremarks']);
+            }
+			    $amz = $this->fullorderamz->find_count($where);			    
+			    
+			    
+
 			
 			
 			 //取得信息列表
@@ -656,8 +737,8 @@ class Systemprint extends Start_Controller {
 			    $smt += $this->fullordersmt->find_count($where);
 			
 			//$total += $this->fullorder_smt->find_count($where);
-			$total = $dlz+$smt+$tt+$xw;
-			$rows = array_merge($info_list,$info_listtt,$info_listxw,$info_listsmt);
+			$total = $dlz+$smt+$tt+$xw+$amz;
+			$rows = array_merge($info_list,$info_listamz,$info_listtt,$info_listxw,$info_listsmt);
 			//$rows = array_slice($rows,$start,$perpage);
 			
 			
@@ -1638,6 +1719,10 @@ class Systemprint extends Start_Controller {
 				else if($fullorder_name == 'fullordertt')
 				{
 					$text['name'] = 'TikTok';
+				}
+					else if($fullorder_name == 'fullorderamz')
+				{
+					$text['name'] = '亚马逊';
 				}
 				else if($fullorder_name == 'fullorderxw')
 				{
@@ -2077,6 +2162,61 @@ class Systemprint extends Start_Controller {
 				}
 				//$info_list[$key]['shipremarks'] = str_replace(array('<','>'),array('&lt;','&gt;'),$value['shipremarks']);
             }
+            
+            
+             $info_listamz = $this->fullorderamz->find_all($where.$wid,'shop,type,orderinfo,number,waybill,express,print,printnumber,library,printtime,shipremarks,ts',$order_str);
+			 //格式化数据
+            foreach ($info_listamz as $key=>$value) 
+		    {
+				$shop = $this->shop->read($value['shop']);
+				$info_listamz[$key]['shop'] = $shop['shopname'];
+				if($value['waybill'] == '0')
+				{
+					$info_listamz[$key]['waybill'] = "";
+				}
+				$express = $this->express->read($value['express']);
+				$info_listamz[$key]['express'] = $express['servicename'];
+				$warehouse = $this->warehouse->read($value['type']);
+				$info_listamz[$key]['type'] = $warehouse['title'];
+				if($value['printtime'] == '0')
+				{
+					$info_listamz[$key]['printtime'] = '<em class="t"></em>';
+				}
+				else
+				{
+					$info_listamz[$key]['printtime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['printtime']).'</em>';
+				}
+				if($value['print'] == 1)
+				{
+					$info_listamz[$key]['print'] = '不可打印';
+				}
+				else if($value['print'] == 2)
+				{
+					$info_listamz[$key]['print'] = '未打印';
+				}
+				else if($value['print'] == 3)
+				{
+					$info_listamz[$key]['print'] = '已打印';
+				}
+				if($value['library'] == 1)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">未出库</em>';
+				}
+				else if($value['library'] == 2)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已出库</em>';
+				}
+				else if($value['library'] == 3)
+				{
+					$info_listamz[$key]['library'] = '<em class="c">已退库</em>';
+				}
+				//$info_list[$key]['shipremarks'] = str_replace(array('<','>'),array('&lt;','&gt;'),$value['shipremarks']);
+            }
+            
+            
+            
+            
+            
 			 $info_listxw = $this->fullorderxw->find_all($where.$wid,'shop,type,orderinfo,number,waybill,express,print,printnumber,library,printtime,shipremarks,ts',$order_str);
 			 //格式化数据
             foreach ($info_listxw as $key=>$value) 
@@ -2129,7 +2269,7 @@ class Systemprint extends Start_Controller {
             $titlename = "<table border=1><td>店铺名称</td><td>仓库</td><td>订单号</td><td>编号</td><td>运单号</td><td>快递</td><td>类型</td><td>打印次数</td><td>状态</td><td>打印时间</td><td>仓库品名</td><td>条数</td></table>";
 			$tail = "\n";
             $filename = $title.".xls";
-            $this->excel->get_fz2(array_merge($info_list,$info_listsmt,$info_listtt,$info_listxw),$titlename,$filename,$tail);
+            $this->excel->get_fz2(array_merge($info_list,$info_listamz,$info_listsmt,$info_listtt,$info_listxw),$titlename,$filename,$tail);
 		}
 	}