| xqd
@@ -591,154 +591,154 @@ if( ! function_exists('widget'))
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-if( ! function_exists('sendSms')) {
|
|
|
- // return string 'success' 为成功
|
|
|
- function sendSms($msg, $mobile){
|
|
|
- $post_data = array();
|
|
|
- $post_data['un'] ="N9304000";
|
|
|
- $post_data['pw'] = "Mask751002@";
|
|
|
- $post_data['msg']="【小洲蔬菜】$msg";
|
|
|
- $post_data['phone'] =$mobile;
|
|
|
- $post_data['rd']=1;
|
|
|
-
|
|
|
- $post_data['needstatus']='true';
|
|
|
- $url='https://sms.253.com/msg/send';
|
|
|
- $data=http_build_query($post_data);
|
|
|
-
|
|
|
- if(function_exists('curl_init')){
|
|
|
- $curl = curl_init();
|
|
|
- curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
-
|
|
|
- if (!empty($data)){
|
|
|
- curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
- }
|
|
|
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
- $output = curl_exec($curl);
|
|
|
- curl_close($curl);
|
|
|
- $result=preg_split("/[,\r\n]/",$output);
|
|
|
- if($result[1]==0){
|
|
|
- $res = "success";
|
|
|
- }else{
|
|
|
- $res = "curl error:".$result[1];
|
|
|
- }
|
|
|
- }elseif(function_exists('file_get_contents')){
|
|
|
- $output=file_get_contents($url.$data);
|
|
|
- $result=preg_split("/[,\r\n]/",$output);
|
|
|
- if($result[1]==0){
|
|
|
- $res = "success";
|
|
|
- }else{
|
|
|
- $res = "error:".$result[1];
|
|
|
- }
|
|
|
- }else{
|
|
|
- $res="error";
|
|
|
- }
|
|
|
- return $res;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-if( ! function_exists('sendMultiSms')) {
|
|
|
- // 群发短信 $mobiles电话号码之间用英文逗号分割
|
|
|
- // return string 'success' 为成功
|
|
|
- function sendMultiSms($msg, $mobiles){
|
|
|
- $post_data = array();
|
|
|
- $post_data['un'] ="M3512322";
|
|
|
- $post_data['pw'] = "N8ecbXn0A7dc18";
|
|
|
- $post_data['msg']="【小洲蔬菜】$msg 回复TD退订";
|
|
|
- $post_data['phone'] =$mobiles;
|
|
|
- $post_data['rd']=1;
|
|
|
-
|
|
|
- $post_data['needstatus']='true';
|
|
|
- $url='https://sms.253.com/msg/send';
|
|
|
- $data=http_build_query($post_data);
|
|
|
-
|
|
|
- if(function_exists('curl_init')){
|
|
|
- $curl = curl_init();
|
|
|
- curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
-
|
|
|
- if (!empty($data)){
|
|
|
- curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
- }
|
|
|
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
- $output = curl_exec($curl);
|
|
|
- curl_close($curl);
|
|
|
- $result=preg_split("/[,\r\n]/",$output);
|
|
|
- if($result[1]==0){
|
|
|
- $res = "success";
|
|
|
- }else{
|
|
|
- $res = "curl error:".$result[1];
|
|
|
- }
|
|
|
- }elseif(function_exists('file_get_contents')){
|
|
|
- $output=file_get_contents($url.$data);
|
|
|
- $result=preg_split("/[,\r\n]/",$output);
|
|
|
- if($result[1]==0){
|
|
|
- $res = "success";
|
|
|
- }else{
|
|
|
- $res = "error:".$result[1];
|
|
|
- }
|
|
|
- }else{
|
|
|
- $res="error";
|
|
|
- }
|
|
|
- return $res;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-if( ! function_exists('sendCaixin')) {
|
|
|
- //return true or false
|
|
|
- function sendCaixin($mobile){
|
|
|
-
|
|
|
- $post_data =$data =$msgdata = array();
|
|
|
-
|
|
|
- $url ="http://www.baidu.com";//回调URL
|
|
|
- $key ="6MG5jNK4Q15907";//密码
|
|
|
-//文字body
|
|
|
- $data['frame']="1"; //文字标识
|
|
|
- $data['part'] ="1";//文字标识
|
|
|
- $data['type']="1" ;
|
|
|
- $data['content']=base64_encode('亲爱的朋友,“芜湖小洲蔬菜”,芜湖人的掌上菜篮子,已是我每天买菜必备工具。好东西首先想到了您,赶快关注使用吧!');
|
|
|
-
|
|
|
-//图片body
|
|
|
- $msgdata['frame']="1";
|
|
|
- $msgdata['part'] ="2";//图片标识
|
|
|
- $msgdata['type']="2" ;//图片标识
|
|
|
- $msgdata['content']=base64_encode(file_get_contents(public_path('app/wap/images/')."qrcode.jpg"));//图片
|
|
|
-
|
|
|
- $post_data['account'] ="C8636841";//账号
|
|
|
- $post_data['ext_id']="72175534217316595927";//自传参数
|
|
|
- $post_data['msg']=json_encode(array($data,$msgdata)) ;//json
|
|
|
- $post_data['phones'] = $mobile;//手机
|
|
|
- $post_data['timestamp'] = time();//时间戳
|
|
|
-
|
|
|
- $post_data['title']= '芜湖小洲蔬菜'; //标题
|
|
|
-
|
|
|
- $sign ='account=' . $post_data['account'].'ext_id=' . $post_data['ext_id'].'msg=' . $post_data['msg'].'phones=' . $post_data['phones'].'timestamp=' . $post_data['timestamp'].'title=' . $post_data['title'].'url=' . $url.'key=' . $key;
|
|
|
- $sign=md5($sign); //加密
|
|
|
- $post_data['sign']=$sign;
|
|
|
- $post_data['url']=$url;
|
|
|
-
|
|
|
- $url='http://caixin.253.com/api/send?';
|
|
|
- $data = http_build_query($post_data);
|
|
|
-
|
|
|
- if(function_exists('curl_init')){
|
|
|
- $curl = curl_init();
|
|
|
- curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
-
|
|
|
- if (!empty($data)){
|
|
|
- curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
- }
|
|
|
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
- $output = curl_exec($curl);
|
|
|
- curl_close($curl);
|
|
|
- $res = json_decode($output);
|
|
|
- if(is_array($res)&&$res['code']==1){
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-}
|
|
|
+//
|
|
|
+//if( ! function_exists('sendSms')) {
|
|
|
+// // return string 'success' 为成功
|
|
|
+// function sendSms($msg, $mobile){
|
|
|
+// $post_data = array();
|
|
|
+// $post_data['un'] ="N9304000";
|
|
|
+// $post_data['pw'] = "Mask751002@";
|
|
|
+// $post_data['msg']="【小洲蔬菜】$msg";
|
|
|
+// $post_data['phone'] =$mobile;
|
|
|
+// $post_data['rd']=1;
|
|
|
+//
|
|
|
+// $post_data['needstatus']='true';
|
|
|
+// $url='https://sms.253.com/msg/send';
|
|
|
+// $data=http_build_query($post_data);
|
|
|
+//
|
|
|
+// if(function_exists('curl_init')){
|
|
|
+// $curl = curl_init();
|
|
|
+// curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
+//
|
|
|
+// if (!empty($data)){
|
|
|
+// curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
+// curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
+// }
|
|
|
+// curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
+// $output = curl_exec($curl);
|
|
|
+// curl_close($curl);
|
|
|
+// $result=preg_split("/[,\r\n]/",$output);
|
|
|
+// if($result[1]==0){
|
|
|
+// $res = "success";
|
|
|
+// }else{
|
|
|
+// $res = "curl error:".$result[1];
|
|
|
+// }
|
|
|
+// }elseif(function_exists('file_get_contents')){
|
|
|
+// $output=file_get_contents($url.$data);
|
|
|
+// $result=preg_split("/[,\r\n]/",$output);
|
|
|
+// if($result[1]==0){
|
|
|
+// $res = "success";
|
|
|
+// }else{
|
|
|
+// $res = "error:".$result[1];
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// $res="error";
|
|
|
+// }
|
|
|
+// return $res;
|
|
|
+// }
|
|
|
+//}
|
|
|
+//
|
|
|
+//if( ! function_exists('sendMultiSms')) {
|
|
|
+// // 群发短信 $mobiles电话号码之间用英文逗号分割
|
|
|
+// // return string 'success' 为成功
|
|
|
+// function sendMultiSms($msg, $mobiles){
|
|
|
+// $post_data = array();
|
|
|
+// $post_data['un'] ="M3512322";
|
|
|
+// $post_data['pw'] = "N8ecbXn0A7dc18";
|
|
|
+// $post_data['msg']="【小洲蔬菜】$msg 回复TD退订";
|
|
|
+// $post_data['phone'] =$mobiles;
|
|
|
+// $post_data['rd']=1;
|
|
|
+//
|
|
|
+// $post_data['needstatus']='true';
|
|
|
+// $url='https://sms.253.com/msg/send';
|
|
|
+// $data=http_build_query($post_data);
|
|
|
+//
|
|
|
+// if(function_exists('curl_init')){
|
|
|
+// $curl = curl_init();
|
|
|
+// curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
+//
|
|
|
+// if (!empty($data)){
|
|
|
+// curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
+// curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
+// }
|
|
|
+// curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
+// $output = curl_exec($curl);
|
|
|
+// curl_close($curl);
|
|
|
+// $result=preg_split("/[,\r\n]/",$output);
|
|
|
+// if($result[1]==0){
|
|
|
+// $res = "success";
|
|
|
+// }else{
|
|
|
+// $res = "curl error:".$result[1];
|
|
|
+// }
|
|
|
+// }elseif(function_exists('file_get_contents')){
|
|
|
+// $output=file_get_contents($url.$data);
|
|
|
+// $result=preg_split("/[,\r\n]/",$output);
|
|
|
+// if($result[1]==0){
|
|
|
+// $res = "success";
|
|
|
+// }else{
|
|
|
+// $res = "error:".$result[1];
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// $res="error";
|
|
|
+// }
|
|
|
+// return $res;
|
|
|
+// }
|
|
|
+//}
|
|
|
+//
|
|
|
+//
|
|
|
+//if( ! function_exists('sendCaixin')) {
|
|
|
+// //return true or false
|
|
|
+// function sendCaixin($mobile){
|
|
|
+//
|
|
|
+// $post_data =$data =$msgdata = array();
|
|
|
+//
|
|
|
+// $url ="http://www.baidu.com";//回调URL
|
|
|
+// $key ="6MG5jNK4Q15907";//密码
|
|
|
+////文字body
|
|
|
+// $data['frame']="1"; //文字标识
|
|
|
+// $data['part'] ="1";//文字标识
|
|
|
+// $data['type']="1" ;
|
|
|
+// $data['content']=base64_encode('亲爱的朋友,“芜湖小洲蔬菜”,芜湖人的掌上菜篮子,已是我每天买菜必备工具。好东西首先想到了您,赶快关注使用吧!');
|
|
|
+//
|
|
|
+////图片body
|
|
|
+// $msgdata['frame']="1";
|
|
|
+// $msgdata['part'] ="2";//图片标识
|
|
|
+// $msgdata['type']="2" ;//图片标识
|
|
|
+// $msgdata['content']=base64_encode(file_get_contents(public_path('app/wap/images/')."qrcode.jpg"));//图片
|
|
|
+//
|
|
|
+// $post_data['account'] ="C8636841";//账号
|
|
|
+// $post_data['ext_id']="72175534217316595927";//自传参数
|
|
|
+// $post_data['msg']=json_encode(array($data,$msgdata)) ;//json
|
|
|
+// $post_data['phones'] = $mobile;//手机
|
|
|
+// $post_data['timestamp'] = time();//时间戳
|
|
|
+//
|
|
|
+// $post_data['title']= '芜湖小洲蔬菜'; //标题
|
|
|
+//
|
|
|
+// $sign ='account=' . $post_data['account'].'ext_id=' . $post_data['ext_id'].'msg=' . $post_data['msg'].'phones=' . $post_data['phones'].'timestamp=' . $post_data['timestamp'].'title=' . $post_data['title'].'url=' . $url.'key=' . $key;
|
|
|
+// $sign=md5($sign); //加密
|
|
|
+// $post_data['sign']=$sign;
|
|
|
+// $post_data['url']=$url;
|
|
|
+//
|
|
|
+// $url='http://caixin.253.com/api/send?';
|
|
|
+// $data = http_build_query($post_data);
|
|
|
+//
|
|
|
+// if(function_exists('curl_init')){
|
|
|
+// $curl = curl_init();
|
|
|
+// curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
+//
|
|
|
+// if (!empty($data)){
|
|
|
+// curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
+// curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
+// }
|
|
|
+// curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
+// $output = curl_exec($curl);
|
|
|
+// curl_close($curl);
|
|
|
+// $res = json_decode($output);
|
|
|
+// if(is_array($res)&&$res['code']==1){
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//}
|