chengkun
2025-05-20 4c1f0f659384d71ce28be1fc0343e56e75568fe1
app/model/notice.model.php
@@ -63,6 +63,7 @@
        return  $ErrlogM -> addErrorLog($uid, $type, $content);
        
    }
    /**
     * 获取邮件、短信模板
     * @param array $data  传入参数
@@ -84,6 +85,7 @@
            return array('status' => -1, 'msg' => '信息模板有误,请联系管理员');
        }
    }
    //替换模板中的变量
    private function _tpl($tpl, $data){
        unset($data['type']);
@@ -185,12 +187,15 @@
        }
        return $retval;
    }
    function insertEmail($data){
       return $this -> insert_into('email_msg',$data);
    }
    function insertMsg($data){
       return $this -> insert_into('moblie_msg',$data);
    }
    /**
     * @desc 根据业务类型,判断后台设置是否开启该类型email提醒,选择设定好的email模板,发送指定类型的邮件
     *
@@ -209,8 +214,7 @@
     *            moblie要发送的手机用户
     *            
     */
    public function sendEmailType($data, $tpl = NULL)
    {
    public function sendEmailType($data, $tpl = NULL) {
        if (! $this->_isKey('type', $data) || ! $this->_isKey('sy_email_'.$data['type'], $this->config) || $this->config['sy_email_'.$data['type']] != 1) {
            return array(
                'status' => - 1,
@@ -252,7 +256,7 @@
   private function checkPhone($phone){
      
      $url='https://u.phpyun.com/phone';
        $url = '';
       $url.='?appSecret='.$this -> config['sy_kh_appsecret'].'&appKey='.$this -> config['sy_kh_appkey'].'&phone='.$phone;
       if (extension_loaded('curl')){
@@ -330,8 +334,7 @@
               $kh_province      =   str_replace(",",",",$this -> config['sy_kh_city']);
               $kh_province_arr   =   explode(',',$kh_province);
               foreach($kh_province_arr as $key => $value)
               {
                    foreach ($kh_province_arr as $key => $value) {
                  $kh_city   =   @explode('/',$value);
                  
                  //设定市级地区的情况下优先判断
@@ -390,6 +393,7 @@
         return array('status' => -1, 'msg' => '发送失败!状态:'.$re['code']."," . $re['message']);
        }
    }
    /**
     * 
     * @param array $data  传入参数
@@ -489,8 +493,7 @@
     * @param   array $data
     * @return  boolean
     */
     public function checkTime($data)
    {
    public function checkTime($data) {
        $cert_validity  =   $this->config['moblie_codetime'] * 60; // 验证码有效时间
        $time           =   time();
        $ctime          =   bcsub($time, $data);
@@ -515,8 +518,7 @@
     * @param string $port 端口:1-PC;2-WAP;5-ADMIN
     * @return array|number[]|string[]
     */
    public function  sendCode($sended, $type, $port='', $user = array(), $length = 6, $validity = 120, $kind = 'msg')
    {
    public function sendCode($sended, $type, $port = '', $user = array(), $length = 6, $validity = 120, $kind = 'msg') {
         
        $time      =  time();
        $overtime  =  $time - $validity;
@@ -630,7 +632,8 @@
         if($num>=5){
            $data['errmsg']  = '请不要频繁发送邮件!';
            $data['error']   = 17;
            echo json_encode($data);die;
                echo json_encode($data);
                die;
         }
         
            if ($type == 'getpass'){
@@ -703,6 +706,7 @@
        }
        return array('error' => $result['status'], 'msg' => $result['msg']);
    }
    //按类别发送验证码
    private function sendType($sended, $type, $code, $kind = 'msg',$user = array(), $port = null){
        
@@ -731,6 +735,7 @@
        }
        return $result;
    }
    //手机验证码类型
    private function codeType($type){
        $status = array(
@@ -740,6 +745,7 @@
            'getpass'  =>  '找回密码'
        );
    }
    //查询接收短信、邮件用户信息
    private function forsend($user){
        $info = array(
@@ -770,8 +776,7 @@
     * @param $tag
     * @return array
     */
    function jycheck($authcode, $tag)
    {
    function jycheck($authcode, $tag) {
        $image  =   false;
        session_start();
@@ -806,4 +811,5 @@
   
   
}
?>