ECTouch系统是一款免费开源的手机商城系统,采用国际标准HTML5+CSS3研发,便于二次开发,小编上次也讲解过如何进行短信接口的替换,前几天一个客户找到我说发货提醒短信发送失败,其他都是正常使用,经过小编的一番代码追踪发现原来发货提醒所调用的文件,与其他文件不是同一个文件,下面我们就来修改这个发货提醒的接口发送文件。
打开项目\include\classes\sms.php文件,修改send方法,修改代码如下:
| 
						1 
						2 
						3 
						4 
						5 
						6 
						7 
						8 
						9 
						10 
						11 
						12 
						13 
						14 
						15 
						16 
						17 
						18 
						19 
						20 
						21 
						22 
						23 
						24 
						25 
						26 
						27 
						28 
						29 
						30 
						31 
						32 
						33 
						34 
						35 | functionsend($phones, $msg, $send_date= '', $send_num= 1, $sms_type= '', $version= '1.0', &$sms_error= '') {        //function send($phones, $msg, &$sms_error = '') {        /* 检查发送信息的合法性 */        $contents= $this->get_contents($phones, $msg);        if(!$contents) {            returnfalse;        }        /* 获取API URL */        if(count($contents) > 1) {            foreach($contentsas$key=> $val) {                $post_data= "u=". $this->sms_name . "&p=". md5($this->sms_password) . "&m=". $val['phones'] . "&c=【".C('shop_name').'】'. rawurlencode($val['content']); //密码可以使用明文密码或使用32位MD5加密                //$get = $this->Post($post_data, $sms_url);                $get= Http::doPost($sms_url, $post_data);                $gets= $this->xml_to_array($get);                sleep(1);            }        } else{            $post_data= "u=". $this->sms_name . "&p=". md5($this->sms_password) . "&m=". $contents[0]['phones'] . "&c=【".C('shop_name').'】'. rawurlencode($contents[0]['content']); //密码可以使用明文密码或使用32位MD5加密            //$get = $this->Post($post_data, $sms_url);            $get= Http::doPost($sms_url, $post_data);            $gets= $this->xml_to_array($get);        }        if($get== '0') {            returntrue;        } else{            $sms_error= $get;            //$this->logResult($sms_error);            return$sms_error;        }    } | 
经过上面的修改发货提醒短信可以正常发送了,报备一下短信宝的VIP模版,这样就可以走短信宝的优质通道,并且免审核了,短信内容3~5秒就可送达。
最新更新
电商类
CMS类
微信类