lvhao 3 mēneši atpakaļ
vecāks
revīzija
257e890e17

+ 7 - 2
core/CoreApp/controllers/Apidsyskxcx.php

@@ -13,6 +13,7 @@ class Apidsyskxcx extends Start_Controller
     {
         parent::__construct();
         $this->load->_model('Model_fullorder','fullorder');
+        $this->load->_model("Model_logic_ding","logic_ding");
     }
     public function _remap($arg, $arg_array)
     {
@@ -56,7 +57,6 @@ class Apidsyskxcx extends Start_Controller
         }
         
         $sercet_str = md5($check_str);
-        throw new Exception("失败");
         if($sercet_str != $token){
             exit("Request permission is illegal");
         }
@@ -69,7 +69,12 @@ class Apidsyskxcx extends Start_Controller
     private function _doRenwu(){
         //必须是云尚快线   打印
         $list = $this->fullorder->find_all("express = 71 and print = 3 and library = 2 and expressstate < 6");
-        die(count($list));
+        
+        $waybill_list = array_column($list,'waybill');
+
+        $split_waybills = array_chunk($waybill_list,10);
+
+        $this->logic_ding->sendToDing(json_encode($split_waybills));
 
     }
 }

+ 5 - 0
core/CoreApp/controllers/Errorlog.php

@@ -4,6 +4,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
  * 由于钉釘现在接口限流了 没办法这边写一个接收器 作为接收需要监听信息的日志记录
  */
 class Errorlog extends Start_Controller {
+    private $ip = ['127.0.0.1','47.105.156.18'];
     public function __construct(){
 		parent::__construct();
         $this->load->_model("Model_logic_tools","logic_tools");
@@ -13,6 +14,10 @@ class Errorlog extends Start_Controller {
     //定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
     {
+        $ip = $_SERVER['REMOTE_ADDR'];
+        if(!in_array($ip,$this->ip)){
+            exit("Unauthorized access");
+        }
 		if($arg == 'ding')//添加
         {
              $this->_ding();