/**
  * 返回活动是否认证
  * @param array $data 字段的数据 形如array(int 行ID => array(int 字段ID => array 字段内容))
  * @param int $tid 帖子id
  * @param int $actmid 分类id
  * @return string HTML
  * @access private
  */
 function isCertified($data, $tid, $actmid)
 {
     global $subject, $tdtime;
     $isCertifiedHtml = '';
     $signupStaus = true;
     $defaultValueTableName = getActivityValueTableNameByActmid();
     if (!$data['iscertified'] && $data['paymethod'] == 1) {
         $tradeinfo = $this->db->get_value("SELECT tradeinfo FROM pw_memberinfo WHERE uid=" . S::sqlEscape($data['authorid']));
         $tradeinfo = unserialize($tradeinfo);
         $alipay = $tradeinfo['alipay'];
         $isBinded = $tradeinfo['isbinded'];
         $isCertified = $tradeinfo['iscertified'];
         if ($isBinded != 'T') {
             //尚未绑定
             if ($data['authorid'] == $this->winduid) {
                 $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_unbind_alipay') . '</p>';
             } else {
                 $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_author_unbind') . '</p>';
             }
         } elseif ($isCertified != 'T') {
             //尚未实名认证
             require_once R_P . 'lib/activity/alipay_push.php';
             $alipayPush = new AlipayPush();
             $is_success = $alipayPush->user_query($data['authorid']);
             //查询是否实名认证
             if ($is_success != 'T') {
                 if ($data['authorid'] == $this->winduid) {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_unauth_alipay') . '</p>';
                 } else {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_author_unpass') . '</p>';
                 }
             } else {
                 $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_activity_unNo') . '</p>';
                 $this->db->update("UPDATE {$defaultValueTableName} SET iscertified=1 WHERE tid=" . S::sqlEscape($tid));
                 //活动通过认证
             }
         } else {
             $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_activity_unNo') . '</p>';
             $this->db->update("UPDATE {$defaultValueTableName} SET iscertified=1 WHERE tid=" . S::sqlEscape($tid));
             //活动通过认证
         }
         $signupStaus = false;
     } elseif ($data['iscertified'] && !$data['batch_no'] && $data['paymethod'] == 1) {
         require_once R_P . 'lib/activity/alipay_push.php';
         $alipayPush = new AlipayPush();
         $certStatus = $alipayPush->create_aa_payment($tid, $data['authorid'], $actmid, $subject);
         //创建AA活动号
         if ($certStatus != 'T') {
             if ($certStatus == 'AA_FAIL_TO_CREATE_AA_NOT_T') {
                 if ($data['authorid'] == $this->winduid) {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_alipayinfo_un') . '</p>';
                 } else {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_alipayAccount') . '</p>';
                 }
             } elseif ($certStatus == 'AA_FAIL_TO_CREATE_AA_FREEZED') {
                 if ($data['authorid'] == $this->winduid) {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_alipay_freeze') . '</p>';
                 } else {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_author_freeze') . '</p>';
                 }
             } elseif ($certStatus == 'AA_FAIL_TO_CREATE_AA_NEED_CERTIFY') {
                 if ($data['authorid'] == $this->winduid) {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_unauth_alipay') . '</p>';
                 } else {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_alipayAccount') . '</p>';
                 }
             } elseif ($certStatus == 'AA_FAIL_TO_CREATE_AA_BEYOND_LIMIT' && $data['signupstarttime'] > $tdtime && $data['signupstarttime'] < $tdtime + 86400) {
                 //报名时间不是今天
                 if ($data['authorid'] == $this->winduid) {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_max_activity') . '</p>';
                 } else {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_max_activity2') . '</p>';
                 }
             } else {
                 if ($data['authorid'] == $this->winduid) {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_fail_No') . '</p>';
                 } else {
                     $isCertifiedHtml .= '<p class="aa_err">' . getLangInfo('other', 'act_err_system_error') . '</p>';
                 }
             }
             $signupStaus = false;
         }
     }
     return array($signupStaus, $isCertifiedHtml);
 }
Beispiel #2
0
}
if ($job == 'user_authentication') {
    //用户身份验证
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $data = $userService->get($winduid, false, false, true);
    $tradeinfo = $data['tradeinfo'] ? $data['tradeinfo'] : '';
    $tradeinfo = unserialize($tradeinfo);
    $user_id = $tradeinfo['user_id'];
    $isBinded = $tradeinfo['isbinded'];
    $isCertified = $tradeinfo['iscertified'];
    if ($user_id && $isBinded == 'T' && $isCertified != 'T') {
        //如果绑定,但未实名认证
        require_once R_P . 'lib/activity/alipay_push.php';
        $alipayPush = new AlipayPush();
        $is_success = $alipayPush->user_query($winduid);
        //查询是否实名认证
        if ($is_success == 'T') {
            $tradeinfo['iscertified'] = $is_success;
            $tradeinfo = addslashes(serialize($tradeinfo));
            $userService->update($winduid, array(), array(), array('tradeinfo' => $tradeinfo));
            echo 'success';
        } else {
            echo 'iscertified_fail';
        }
    } elseif ($isBinded != 'T') {
        echo 'isbinded_fail';
    }
    ajax_footer();
} elseif ($job == 'upload') {
    //附件上传