备份开发进度

This commit is contained in:
qinzongqing 2023-04-14 15:52:20 +08:00
parent 8546ffe85e
commit 7445094c33
2 changed files with 65 additions and 7 deletions

View File

@ -17,14 +17,14 @@ class Oauth2Controller extends ControllerBase{
* http://weapp.wemediacn.net/d/tiffany/api/oauth2/test?qaz=wsx * http://weapp.wemediacn.net/d/tiffany/api/oauth2/test?qaz=wsx
*/ */
function testAction(){ function testAction(){
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/code"; $url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/code";
//$url = "http://127.0.0.1/tiffany/api/oauth2/code?qaz=wsx"; //$url = "http://127.0.0.1/tiffany/api/oauth2/code?qaz=wsx";
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/accesstoken"; //$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/accesstoken";
$url = "http://127.0.0.1/tiffany/api/oauth2/accesstoken?qaz=wsx"; //$url = "http://127.0.0.1/tiffany/api/oauth2/accesstoken?qaz=wsx";
$post_arr = array(); $post_arr = array();
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7"; $post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
$post_arr['appsecrect'] = "b82015bd-8d4c-4df8-87a8-c25477a8976f"; $post_arr['appsecrect'] = "b82015bd-8d4c-4df8-87a8-c25477a8976f";
$post_arr['code'] = "4w6cuxof5gvhi9szpeabj32l71mqrtd8"; $post_arr['code'] = "c21ffda53bb349ff9461c92e4371da93";
$post_json = json_encode($post_arr); $post_json = json_encode($post_arr);
$result = $this->__http_post_request($url, $post_json, true); $result = $this->__http_post_request($url, $post_json, true);
print_r($result); die; print_r($result); die;

View File

@ -38,9 +38,9 @@ class SmsController extends ControllerBase{
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/sms/send"; //$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/sms/send";
//$url = "http://127.0.0.1/tiffany/api/sms/send?qaz=wsx"; //$url = "http://127.0.0.1/tiffany/api/sms/send?qaz=wsx";
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/sms/authcode"; //$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/sms/authcode";
$url = "http://127.0.0.1/tiffany/api/sms/authcode?qaz=wsx"; //$url = "http://127.0.0.1/tiffany/api/sms/authcode?qaz=wsx";
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/sms/query_reports"; //$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/sms/query_reports";
//$url = "http://127.0.0.1/tiffany/api/sms/query_reports?qaz=wsx"; $url = "http://127.0.0.1/tiffany/api/sms/query_reports?qaz=wsx";
$post_arr = array(); $post_arr = array();
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7"; $post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
$post_arr['mobile'] = "13501882318"; $post_arr['mobile'] = "13501882318";
@ -56,7 +56,10 @@ class SmsController extends ControllerBase{
$post_arr['params5'] = 5; $post_arr['params5'] = 5;
$post_arr['params6'] = 6; $post_arr['params6'] = 6;
$post_arr['is_resend'] = true; $post_arr['is_resend'] = true;
$post_arr['min_id'] = ""; $post_arr['min_id'] = 4115398953;
$post_arr['min_id'] = 4116344287;
$post_arr['min_id'] = 4116344229;
$post_arr['min_id'] = 0;
$post_json = json_encode($post_arr); $post_json = json_encode($post_arr);
$result = $this->__http_post_request($url, $post_json, true); $result = $this->__http_post_request($url, $post_json, true);
print_r($result); die; print_r($result); die;
@ -796,7 +799,62 @@ class SmsController extends ControllerBase{
} }
//如果以上判断都通过 //如果以上判断都通过
if(empty($rs['errcode'])){ if(empty($rs['errcode'])){
//设置查询MinID
$MinID = isset($request_arr['min_id'])?$request_arr['min_id']:0;
$MinID = (int)$MinID;
//设置查询TokenID
$TokenID = $AppInfo->SmsToken;
//开发阶段转为使用测试TokenID
$TokenID = "7100477830459267";
//准备查询下行报告
$url = "https://www.wemediacn.net/webservice/smsservice.asmx/QuerySmsSeqReport?TokenID=$TokenID&MinID=$MinID";
//获取查询结果
$xml = $this->__https_request($url);
//转换查询结果格式
$array = $this->__change_xml_to_array($xml);
//获取查询结果提示
$string = !empty($array[0])?$array[0]:"";
//如果查询失败
if(!isset($array['@attributes'])){
//告知用户"系统繁忙,请稍候再试"
$rs['errcode'] = -1;
$rs['errmsg'] = "系统繁忙,请稍候再试";
$rs['data'] = null;
}
//如果查询成功
else{
//告知用户"ok"
//注意:
//原代码逻辑中有多返回一个@count而文档中则没有写到
//此处先遵循原代码逻辑,而不按照文档中所写的不做返回
$rs['errmsg'] = "ok";
$rs['errcode'] = 0;
$rs['data']['NewDataSet']['@nextID'] = $array['@attributes']['nextID'];
$rs['data']['NewDataSet']['@count'] = $array['@attributes']['count'];
$rs['data']['NewDataSet']['@xmlns'] = "";
//如果无新下行报告
if(empty($array['result'])){
//设置返回结果
$rs['data']['NewDataSet']['result'] = array();
}
//如果有新下行报告
else{
//如果有新下行报告,但只有一条
if($array['@attributes']['count']==1){
//转换为多维数组
$array['result'] = array(0=>$array['result']);
}
//循环新下行报告
foreach($array['result'] as $result){
//转换查询结果
$result['org_messageid'] = $result['org_messageid']!=array()?$result['org_messageid'][0]:null;
$result['ip'] = $result['ip']!=array()?$result['ip'][0]:null;
//设置返回结果
$rs['data']['NewDataSet']['result'][] = $result;
}
}
}
} }
} }
} }