Browse Source

提交0120晚上查找报错等级原因

longyi 6 months ago
parent
commit
d116a282f4

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

@@ -55,6 +55,9 @@ class Aatest extends Start_Controller {
 		if($arg == 'fout')
         {
              $this->_fout();
+        }else if($arg == 'ceshi')
+        {
+             $this->_ceshi();
         }else{
 			$this->_a($arg_array);
 		}
@@ -119,4 +122,41 @@ class Aatest extends Start_Controller {
         //$this->fedexv1->makeAccessToken();
 		
 	}
+	
+	public function  _ceshi(){
+	    $arr =[1,2];
+	    var_dump($arr[3]);
+	   // $arr = [
+	   //         '4600368432',
+	   //         '2800005184',
+	   //         '3800007040',
+	   //         '3600656330',
+	   //         '3600656403',
+	   //         '3800006595'
+	   //     ];
+	   //$order_list = $this->fullorder->find_all('orderinfo in ('.implode(',',$arr).')');
+	   //foreach ($order_list as $k=>$v){
+	   //    $shop = $this->shop->read($v['shop']);
+	   //    $this->_klarnadata($v['paypal'],$shop['klarnaname'],$shop['klarnapass'],$v['number']);
+	   //    usleep(10);
+	   //}
+	}
+	
+	public function _klarnadata($paypal,$name,$pass,$number)
+    {
+		$url = 'https://api-na.klarna.com/ordermanagement/v1/orders/'.$paypal;
+		$header[] = "Content-Type:application/json";
+        $header[] = "Authorization: Basic ".base64_encode($name.":".$pass);
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+        $res = curl_exec($ch);
+        curl_close($ch);
+		$res = json_decode($res,true);
+	
+		$this->logic_ding->sendToDing($number."API【2042】".json_encode($res));
+	}
 }

File diff suppressed because it is too large
+ 1 - 6
core/CoreApp/controllers/Api.php


+ 13 - 12
core/CoreApp/models/Model_logic_crm.php

@@ -50,20 +50,21 @@ class Model_logic_crm extends Lin_Model {
         $sku_list = explode(",",$order_info['issku']);
         $product_list = explode(",",$order_info['product']);
         $qty_list = explode(";",$order_info['quantity']);
-        try{
-             foreach($sku_list as $key => $value){
-                $item_list[] = [
-                    "name"=>$product_list[$key],
-                    "sku"=>$value,
-                    "qty"=>isset($qty_list[$key])?$qty_list[$key]:1,
-                ];
+        $flag = false;
+        foreach($sku_list as $key => $value){
+            if(empty($product_list[$key])){
+                $flag= true;
             }
-
-            
-        }catch(Exception $e){
-           //防止品名和数量对不上  直接放弃不发了
-           return [];
+            $item_list[] = [
+                "name"=>$product_list[$key],
+                "sku"=>$value,
+                "qty"=>isset($qty_list[$key])?$qty_list[$key]:1,
+            ];
         }
+
+       if($flag){
+            return ;
+       }
         // foreach($sku_list as $key => $value){
         //     $item_list[] = [
         //         "name"=>$product_list[$key],

+ 7 - 7
core/CoreSys/core/Exceptions.php

@@ -269,14 +269,14 @@ class CI_Exceptions {
 		$buffer = ob_get_contents();
 		ob_end_clean();
 		echo $buffer;
-		
+		//不能这样执行了  这样调会造成报错 程序就不执行
 		//此处是为了方便在运行代码中好切片 获取造成错误的数据
-		throw new ErrorException(json_encode([
-			'severity' => $severity,
-			'message' => $message,
-			'filepath' => $filepath,
-			'line' => $line
-		]));
+// 		throw new ErrorException(json_encode([
+// 			'severity' => $severity,
+// 			'message' => $message,
+// 			'filepath' => $filepath,
+// 			'line' => $line
+// 		]));
 	}
 
 }