待发短信

在线客服
产品支持 短信宝客服
合作渠道 渠道合作
服务咨询

4001-021-502

工作时间

9:00-21:00

求职招聘小程序V4.0.89新增短信宝接口

微擎是一款免费开源的公众平台管理系统,基于web2.0技术架构,他有很多的扩展模块,二次开发也非常方便。其中求职招聘小程序是微擎应用市场下载量比较高的求职招聘类小程序,小编对于这套系统还是比较了解的。今天就以替换短信接口为例告诉大家如何进行二次开发,使用的短信接口是我们短信宝短信群发平台的接口,我们短信宝短信群发平台非常稳定,发送速度快,注册就送测试短信,推荐大家使用

首先我们打开项目:\weixinmao_zp\wxapp.php 新增短信宝接口方法

?
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
public function doPageSendsms()
   {
        global $_GPC, $_W;
      $phone = $_GPC['phone'];
      $is_user = pdo_fetch("SELECT id,tel FROM " . tablename('weixinmao_zp_userinfo') ." WHERE  uniacid=:weid AND tel=".$phone,array(":weid" => $_W['uniacid']));
 
      if($is_user)
         return $this->result(0, 'success', array('msg'=>'手机号已经存在','error'=>1));
 
      $statusStr = array(
      "0" => 'success',
      "-1" => "参数不全",
      "-2" => "服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!",
      "30" => "密码错误",
      "40" => "账号不存在",
      "41" => "余额不足",
      "42" => "帐户已过期",
      "43" => "IP地址限制",
      "50" => "内容含有敏感词"
   );
 
         $intro = pdo_fetch("SELECT smsaccount,smspwd FROM " . tablename('weixinmao_zp_intro')." WHERE   uniacid=:uniacid",array(":uniacid" => $_W['uniacid']));
 
 
 
      $smsapi = "https://www.smsbao.com/"; //短信网关
      $user = $intro['smsaccount']; //短信平台帐号
      $pass = md5($intro['smspwd']); //短信平台密码
      $code = rand(100000,999999);
      $content="验证码为:".$code;//要发送的短信内容
      $sendurl = $smsapi."sms?u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content);
      $result =file_get_contents($sendurl) ;
 
       if( $statusStr[$result]=='success')
         {
 
            //$data = array( 'mobile'=>$phone,'create_time'=>time(),'verify_code'=>$code);
            //$is_exist = M("mobile_verify_code")->where(array('mobile'=>$phone))->find();
 
 
            $is_exist = pdo_fetch("SELECT id FROM " . tablename('weixinmao_zp_mobile_verify_code') ." WHERE  uniacid=:weid AND phone=".$phone,array(":weid" => $_W['uniacid']));
 
 
            if($is_exist)
               {
            $data = array(
               'verify_code'=>$code,
                    'createtime' => TIMESTAMP,
                         );
                    pdo_update('weixinmao_zp_mobile_verify_code', $data, array('mobile' => $mobile,'uniacid'=>$_W['uniacid']));
               }else{
 
                   $data = array(
                    'uniacid' => $_W['uniacid'],
               'mobile'=>$phone,
               'verify_code'=>$code,
                    'createtime' => TIMESTAMP,
                         );
 
                    pdo_insert('weixinmao_zp_mobile_verify_code', $data);
                    $id = pdo_insertid();
 
               }
 
            return $this->result(0, 'success', array('msg'=>'发送成功','error'=>0));
 
         }else{
         return $this->result(0, 'success', array('msg'=>'发送失败','error'=>1));
 
            }
 
 
   }

经过上面的替换,短信宝的短信平台已经替换成功了,可以正常使用了。

报备一下短信宝的VIP模板,这样就可以走短信宝的优质通道了,即便遇到敏感文字我们都不会人工审核,短信内容3~5秒就可送达。

另外我们开发好的求职招聘小程序V4.0.89插件已经开发好了,点击此链接 下载及查看安装流程。

开源插件

最新更新

电商类

CMS类

微信类

文章标签