| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | 
							- <?php
 
- /**
 
-  * 对接crm接口
 
-  */
 
- class Model_logic_ding extends Lin_Model {
 
-     function __construct(){
 
-         parent::__construct();
 
-         $this->load->_model("Model_logic_tools","logic_tools");
 
-         $this->load->_model("Model_zzjobs","zzjobs");
 
-     }
 
-     public $key = "ly20250115@0911";
 
-     //public $key = "Hello, World!";
 
-     public function getKey(){
 
-         return $this->key;
 
-     }
 
-     public $url = "https://1.wepolicy.cn/errorlog/ding";
 
-     //public $url = "http://cerp.wepolicy.cn/errorlog/ding";
 
-     public function sendToDing($error_msg){
 
-         $data = [
 
-             'bs'=>$this->logic_tools->toolsjiami($this->key),
 
-             'content'=>$error_msg,
 
-         ];
 
-         $data = json_encode($data,JSON_UNESCAPED_UNICODE);
 
-         $ch = curl_init($this->url);
 
-         // 设置cURL选项 
 
-         $options = array(
 
-             CURLOPT_SSL_VERIFYPEER=>false,
 
-             CURLOPT_SSL_VERIFYHOST=>false,
 
-             CURLOPT_RETURNTRANSFER => true,   
 
-             CURLOPT_POST => true,             
 
-             CURLOPT_POSTFIELDS => $data,  
 
-             CURLOPT_HTTPHEADER => [
 
-                 'Content-Type: application/json'
 
-             ],
 
-             CURLOPT_ENCODING => "gzip,deflate"
 
-         );
 
-         // 应用这些选项到cURL会话
 
-         curl_setopt_array($ch, $options);
 
-         // 执行cURL会话并获取响应
 
-         $response = curl_exec($ch);
 
-        
 
-         
 
-           // 检查是否有错误发生
 
-        if ($response === false) {
 
-            $error = curl_error($ch);
 
-            curl_close($ch);
 
-            return [
 
-                "code"=> -1,
 
-                "msg"=> $error
 
-            ];
 
-        }
 
-       
 
-        // 关闭cURL会话
 
-        curl_close($ch);  
 
-     }
 
-     /**
 
-      * 添加到执行队列上
 
-      */
 
-     public function addJobs($type,$params){
 
-         $this->zzjobs->insert([
 
-             'status'=>0,
 
-             'quque'=>$type,
 
-             'payload'=>json_encode($params),
 
-             'do_interval'=>1,
 
-             'create_time'=>time(),
 
-         ]);
 
-     }
 
- }
 
 
  |