lvhao hai 1 mes
pai
achega
b3bf2af28c
Modificáronse 1 ficheiros con 121 adicións e 0 borrados
  1. 121 0
      core/CoreApp/controllers/Aatest.php

+ 121 - 0
core/CoreApp/controllers/Aatest.php

@@ -80,6 +80,23 @@ class Aatest extends Start_Controller {
     //定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
     { 
+
+			
+			$data = $this->fullordertt->get_orderinfo("577020026957566570");
+				
+			$bctime = date('Ymd',time());
+			if($data['library'] != 2){
+				echo json_encode(array('msg'=>'此单不是出库状态,不允许退货','success'=>false));exit;
+			}
+			if($data['returndata'] != "")
+			{
+				echo json_encode(array('msg'=>'请求失败,已有Return Label信息!','success'=>false));exit;
+			}
+			$barcode = $this->usps->get_return_two($data);
+			echo "<pre>";
+			print_r($barcode);
+			die;
+		 	 die;
 			echo "<pre>";
 			var_dump(date("Y-m-d H:i:s"));
 		   $post['shopify'] = 'https://ecdfe1ed62bedcbc70408fe0cd23ec40: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@karla-c561.myshopify.com/admin/api/2023-07/orders.json?status=any&limit=100';
@@ -178,6 +195,46 @@ class Aatest extends Start_Controller {
 		//$this->job_get3pewaybillid->do_job();
     }
 
+
+	public function _error(){
+		// echo $c;
+		set_error_handler(function($severity, $message, $file, $line) {
+			// 自定义错误处理逻辑
+			
+			throw new ErrorException($message, 0, $severity, $file, $line);
+			//return true; // 返回true表示已处理,阻止CI继续处理
+		});
+
+		set_exception_handler(function($exception) {
+			// 自定义异常处理逻辑
+			// 一般也就是处理一下抛出可允许的错误 允许往下执行  目前这里不做任何处理  只关注于 sql的错误和程序执行的异常
+		});
+		$this->db->db_debug = false;
+		$this->db->trans_begin();
+		try{ 
+			$do_sql = $this->db->insert('table', []); 
+			if(!$do_sql){
+				throw new Exception("sql error:【".$this->db->error()['message']."】");
+			}
+			
+			
+		}catch(Exception $e){
+			$this->db->trans_rollback();
+			exit(json_encode(['msg'=>$e->getMessage(),'success'=>false],JSON_UNESCAPED_UNICODE));
+		}finally{
+			if ($this->db->trans_status() === TRUE)
+			{
+				$this->db->trans_commit();
+				exit(json_encode(['msg'=>"操作成功",'success'=>true],JSON_UNESCAPED_UNICODE));
+			}
+			else
+			{
+				$this->db->trans_rollback();
+				exit(json_encode(['msg'=>"sql语句执行",'success'=>false],JSON_UNESCAPED_UNICODE));
+			}
+		}
+
+	}
 	public function _plcl(){
 	
 		$typeclass = [];
@@ -983,5 +1040,69 @@ class Aatest extends Start_Controller {
 		die;
 	}
 	
+	public function cc(){
+		$filename = date("Y-m-d") . "产品入库导出.xls";
+		$str = "<html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">
+		<head>
+		<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
+		<!--[if gte mso 9]>
+		<xml>
+			<x:ExcelWorkbook>
+				<x:ExcelWorksheets>
+					<x:ExcelWorksheet>
+						<x:Name>产品入库</x:Name>
+						<x:WorksheetOptions>
+							<x:Print>
+								<x:ValidPrinterInfo />
+							</x:Print>
+						</x:WorksheetOptions>
+					</x:ExcelWorksheet>
+				</x:ExcelWorksheets>
+			</x:ExcelWorkbook>
+		</xml>
+		<![endif]-->
+		<style>
+			tr { mso-height-source: auto; }
+			.fixed-height { 
+				height: 100px; /* 设置固定行高 */
+				mso-height-source: userset; /* 强制Excel使用设定高度 */
+			}
+				
+			
+			
+		</style>
+		</head>
+		<body>";
+		
+		$str .= "<table border='1' cellspacing='0' style='border-collapse: collapse; font-family: Microsoft Yahei; font-size: 13px;'>"; 
+		$str .= "<tr >"; // 应用固定高度类
+		$str .= "<td>产品ID</td>";
+		$str .= "<td>图片1</td>";
+		$str .= "</tr>";
+		
+		$str .= "<tr class='fixed-height'>"; // 应用固定高度类
+		$str .= "<td>ceshi12321312312312312312312312312312312</td>";    
+		$str .= '<td >
+		<table border="0">
+			<tr class="fixed-height" >
+			<td ><img class="excel-image" width="70" height="auto" src="http://1.wepolicy.cn/data/img/20250703/20250703_085106_9716.png"></td>
+			<td ><img class="excel-image" width="70" height="auto" src="http://1.wepolicy.cn/data/img/20250703/20250703_085106_9716.png"></td>
+			</tr>
+		</table>
+		</td>';    
+		// $str .= '<td class="image-cell" style="width: 100px; height: 100px;"><img class="excel-image" width="80" height="auto" src="http://1.wepolicy.cn/data/img/20250703/20250703_085106_9716.png"></td>';    
+		$str .= "</tr>";
+		
+		$str .= "</table></body></html>"; 
+		
+		header("Content-Type: application/vnd.ms-excel; charset=utf-8"); 
+		header("Content-Disposition: attachment; filename=".$filename); 
+		header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
+		header("Pragma: no-cache"); 
+		header("Expires: 0"); 
+		exit($str); 
+	}
+
+
 	
 }