コード例 #1
0
ファイル: Login.php プロジェクト: lanma121/superPrize
 public function __execute()
 {
     //判断验证码
     $image = new Arch_ValidImage();
     //验证数据信息
     $data = $this->__verify();
     //数据信息有误
     if (empty($data)) {
         return array('result' => 1);
     }
     //验证码错误
     if ($image->check($data['code']) == false) {
         return array('result' => 2);
     }
     //会员信息
     $userInfo = $this->sUser->getUserInfoByMobile($data['name']);
     //账号错误
     if (!($userInfo['users_id'] > 0)) {
         return array('result' => 3);
     }
     //密码错误
     if (!$this->sPassport->checkPw($data['pass'], $userInfo['users_pass'])) {
         return array('result' => 4);
     }
     //账号被冻结
     if (intval($userInfo['status']) != 1) {
         return array('result' => 5);
     }
     //获取会员积分信息
     $memberInfo = $this->sMember->getMemberInfoByRid($userInfo['relation_id']);
     //会员积分异常
     if (intval($userInfo['users_points']) != intval($memberInfo['member_points'])) {
         return array('result' => 6);
     }
     //判断会员当天是否首次登录
     $recordCount = $this->sRecord->checkFirstLoginToDayByMid($memberInfo['member_id']);
     //增加登录积分
     if (intval($recordCount) <= 0) {
         //格式化参数信息
         $param = array('uid' => $userInfo['users_id'], 'mid' => $memberInfo['member_id'], 'rid' => $userInfo['relation_id']);
         //更新会员基本信息
         try {
             Blue_Commit::call('User_Login', $param);
         } catch (Exception $e) {
             //数据更新失败
             return array('result' => 7);
         }
     }
     //保存会员登录信息
     $userInfo = array('users_id' => $userInfo['users_id'], 'relation_id' => $userInfo['relation_id'], 'member_id' => $memberInfo['member_id']);
     $this->setLogin(array('user_info' => $userInfo));
     //登录成功
     return array('result' => 8);
 }
コード例 #2
0
ファイル: Draw.php プロジェクト: lanma121/superPrize
 public function __execute()
 {
     //验证数据信息
     $data = $this->__verify();
     //数据信息有误
     if (empty($data)) {
         return array('result' => 1);
     }
     //获取会员信息
     $usersInfo = $this->sUser->getUserInfoById($data['uid']);
     //会员基本信息异常
     if (!(intval($usersInfo['relation_id']) > 0)) {
         return array('result' => 2);
     }
     //获取积分信息
     $memberInfo = $this->sMember->getMemberInfoByRid($usersInfo['relation_id']);
     //会员积分账号异常
     if (!(intval($memberInfo['member_id']) > 0)) {
         return array('result' => 3);
     }
     //获取奖品信息
     $prizeInfo = $this->sPrize->getPrizeInfoById($data['pid']);
     //奖品状态异常
     if (intval($prizeInfo['prize_status']) != 1) {
         return array('result' => 4);
     }
     //会员积分异常
     if (intval($usersInfo['users_points']) != intval($memberInfo['member_points'])) {
         return array('result' => 5);
     }
     //需要身份认证
     if (intval($prizeInfo['prize_auth']) == 0 && empty($memberInfo['id_card'])) {
         return array('result' => 6);
     }
     //冠名店铺认证[获取店铺信息]
     if (!empty($prizeInfo['prize_agents']) && $prizeInfo['prize_agents'] != '0') {
         $rids = $this->sAgent->getAgentRidsByAids($prizeInfo['prize_agents']);
         //获取店铺积分信息
         if (!empty($rids)) {
             $mids = $this->sMember->getMemeberMidsByRids($rids);
         }
         //获取会员在店铺的消费记录信息
         if (!empty($mids)) {
             $cids = $this->sRecord->getRecotdCidsByUmidAndAids($memberInfo['member_id'], $mids);
         }
         //未在该店铺消费过
         if (empty($cids)) {
             return array('result' => 7);
         }
     }
     //消费地区认证认证[获取该地区旗下所有店铺信息]
     if (!empty($prizeInfo['prize_locats']) && intval($prizeInfo['prize_locats'] > 0)) {
         //变量初始化
         $zoneId = $cityId = $discId = 0;
         //消费地区认证认证[获取该地区旗下所有店铺信息]
         if (intval($prizeInfo['prize_zone']) > 0) {
             $zoneId = intval($prizeInfo['prize_zone']);
         }
         if (intval($prizeInfo['prize_city']) > 0) {
             $cityId = intval($prizeInfo['prize_city']);
         }
         if (intval($prizeInfo['prize_disc']) > 0) {
             $discId = intval($prizeInfo['prize_disc']);
         }
         //获取店铺积分信息
         $mids = $this->sMember->getMemberMidsByArea($zoneId, $cityId, $discId);
         //获取会员在店铺的消费记录信息
         if (!empty($mids)) {
             $cids = $this->sRecord->getRecotdCidsByUmidAndAids($memberInfo['member_id'], $mids);
         }
         //未在该地区消费过
         if (empty($cids)) {
             return array('result' => 8);
         }
     }
     //会员积分不足
     if (intval($usersInfo['users_points']) < intval($prizeInfo['prize_draw_currency'])) {
         return array('result' => 9);
     }
     //验证码错误
     if (!empty($data['cod'])) {
         $image = new Arch_ValidImage();
         if ($image->check($data['cod']) == false) {
             return array('result' => 10);
         }
     }
     //验证当前会员是否连续投注
     $recordInfo = $this->sPrize->getRecordInfoLastByPid($data['pid']);
     if (empty($data['cod']) && intval($recordInfo['prize_user_uid']) == intval($data['uid'])) {
         return array('result' => 11);
     }
     //验证通过可以进行投注
     return array('result' => 12);
 }
コード例 #3
0
ファイル: Valid.php プロジェクト: lanma121/superPrize
 public function __execute()
 {
     $image = new Arch_ValidImage();
     $image->display();
 }