1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- require_once 'DB_PDO.class.php';
- require_once 'conf.class.php';
- require_once 'SendMsg.class.php';
- /**
- * 监控订单同步
- */
- #设置时区
- date_default_timezone_set('PRC');
- $_PDO=DB_PDO::getInstance( conf::$DB_CONF );
- $nowtime = time();
- $sql = " select update_time from ftxia_taoke_detail2 order by id desc limit 1";
- $stmt = $_PDO->prepare($sql);
- $stmt->execute();
- $result = $stmt->fetch(PDO::FETCH_ASSOC);
- $stime = $result['update_time'];
- $stime = strtotime($stime);
- if($stime+1200 < $nowtime){
- $n = ($nowtime - $stime)/60;
- $n = intval($n);
- //发报警短信
- $res = sendMsg('18501257479');
- $res = sendMsg('15120071946');
- $res = sendMsg('18346660331');
- $res = sendMsg('15921609780');
- exit('订单同步异常,超过'.$n.'分钟未同步');
- }
- echo '未发现异常';
- exit;
- function sendMsg ($mobile){
- $params = array();
- $params['mobile'] = $mobile;
- $n = mt_rand(0,1);
- echo '<pre>';
- if($n == 1){
- //阿里测试
- $params['SignName'] = '猎豆优选';
- $params['tpl_id'] = 'SMS_151997083';
- //$params['extra']['code'] = '1112';
- //$params['extra']['product'] = '猎豆';
- $result = SendMsg::AliSendMsg($params);
- print_r($result);
- return $result;
- }
- //天瑞测试
- /*
- $params['SignName'] = '猎豆优选';
- $params['tpl_id'] = '30290';
- //$params['extra']['code'] = '111256';
- //$params['extra']['minutes'] = 2;
- $result = SendMsg::TruiSendMsg($params);
- var_dump($result);exit;
- */
- //云片测试
- $params['tpl_id'] = '2619986';
- //$params['extra']['code'] = '9000';
- //$params['extra']['minutes'] = 2;
- $params['extra'] = array();
- $result = SendMsg::YpianSendMsg($params);
- print_r($result);
- return $result;
- }
|