123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Model_settingtest extends Lin_Model
- {
- function __construct(){
- parent::__construct();
- $this->load_table('setting');
- }
-
-
-
- public function get_yytoken_101()
- {
- $setting = $this->setting->get_data();
-
- $time = time();
-
- $yytoken = $setting['yytoken']['svalue'];
- $yytokentime = $setting['yytoken']['time'];
- // if(($yytokentime - $time) < 0)
- // {
- /** 获取Token **/
- $url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=001&orgCode=101&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $res = curl_exec($ch);
- $headerA = curl_getinfo($ch);
- $a = json_decode($res,true);
- return $a['Data'];
- /** 获取Token **/
- // }
- // else
- // {
- // return $yytoken;
- // }
-
-
-
- }
-
- public function get_yytoken_120()
- {
- $setting = $this->setting->get_data();
- $time = time();
-
-
- $yytoken = $setting['yytoken_gc']['svalue'];
- $yytokentime = $setting['yytoken_gc']['time'];
- // if(($yytokentime - $time) < 0)
- // {
- /** 获取Token **/
- $url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=001&orgCode=120&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $res = curl_exec($ch);
- $headerA = curl_getinfo($ch);
- $a = json_decode($res,true);
- return $a['Data'];
- /** 获取Token **/
- // }
- // else
- // {
- // return $yytoken;
- // }
-
-
-
- }
-
-
- public function get_yytoken_130()
- {
- $setting = $this->setting->get_data();
- $time = time();
-
- $yytoken = $setting['yytoken_xs']['svalue'];
- $yytokentime = $setting['yytoken_xs']['time'];
- // if(($yytokentime - $time) < 0)
- // {
- /** 获取Token **/
- $url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=001&orgCode=130&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $res = curl_exec($ch);
- $headerA = curl_getinfo($ch);
- $a = json_decode($res,true);
- return $a['Data'];
- /** 获取Token **/
- // }
- // else
- // {
- // return $yytoken;
- // }
-
-
-
- }
- public function get_yytoken_140()
- {
- $setting = $this->setting->get_data();
- $time = time();
-
- $yytoken = $setting['yytoken_xs']['svalue'];
- $yytokentime = $setting['yytoken_xs']['time'];
- // if(($yytokentime - $time) < 0)
- // {
- /** 获取Token **/
- $url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=001&orgCode=140&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $res = curl_exec($ch);
- $headerA = curl_getinfo($ch);
- $a = json_decode($res,true);
- return $a['Data'];
- /** 获取Token **/
- // }
- // else
- // {
- // return $yytoken;
- // }
-
-
-
- }
- } //end class
|