Example #1
0
 public function __execute()
 {
     //参数信息过滤
     $data = $this->__verify();
     //数据信息不完整
     if (!($data && count($data) > 0)) {
         return array('result' => 1);
     }
     //获取分类信息
     $groupInfo = $this->sPrize->getGroupInfoById($data['id']);
     //当前分类已存在
     if (intval($data['id']) > 0 && intval($groupInfo['id']) > 0) {
         //编辑奖品
         try {
             $param = array('name' => $data['name'], 'mark' => $data['mark'], 'id' => intval($data['id']));
             Blue_Commit::call('Super_Prize_Group_Edit', $param);
             return array('result' => 2);
         } catch (Exception $e) {
             //操作失败
             return array('result' => 4);
         }
     } else {
         //新增奖品
         try {
             $param = array('name' => $data['name'], 'mark' => $data['mark']);
             Blue_Commit::call('Super_Prize_Group_Add', $param);
             return array('result' => 3);
         } catch (Exception $e) {
             //操作失败
             return array('result' => 4);
         }
     }
 }
Example #2
0
 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);
 }
Example #3
0
 public function __execute()
 {
     //验证数据信息
     $data = $this->__verify();
     //数据信息有误
     if (!(intval($data['pid']) > 0)) {
         return array('result' => 0);
     }
     //统计同一款奖品的中奖用户信息
     $prizeInfo = $this->sPrize->getPrizeInfoById($data['pid']);
     //奖品信息异常
     if (!(intval($prizeInfo['id']) > 0)) {
         return array('result' => 1);
     }
     //判断是否已经产生中奖会员id
     if (intval($prizeInfo['prize_win_id']) > 0) {
         $wid = intval($prizeInfo['prize_win_id']);
     } else {
         //获取当前奖品抽奖人员列表
         $wid = $this->sPrize->getPrizeUserWidByPid($data['pid']);
     }
     //进到倒计时摇奖
     if (!(intval($prizeInfo['prize_start_time']) > 0 && intval($data['pid']) > 0 && intval($wid) > 0)) {
         return array('result' => 2);
     }
     //结束时间
     $end = intval($prizeInfo['prize_start_time'] + $prizeInfo['prize_wait_time'] + $prizeInfo['prize_buffer_time']);
     //进到倒计时摇奖
     if (intval($prizeInfo['prize_start_time']) > 0 && intval($data['pid']) > 0 && intval($end) > 0 && intval($wid) > 0) {
         //获取中奖会员信息
         $recordInfo = $this->sPrize->getRecordInfoById($wid);
         //获取中奖会员最大期数
         if (intval($recordInfo['id']) > 0 && intval($recordInfo['prize_user_order']) > 0) {
             $order = intval($recordInfo['prize_user_order']);
         } else {
             $order = $this->sPrize->getPrizeUserMaxOrder(true);
         }
         //启动倒计时
         $param = array('id' => intval($wid), 'pid' => intval($data['pid']), 'end' => intval($end), 'ord' => intval($order));
         try {
             Blue_Commit::call('Super_Start', $param);
         } catch (Exception $e) {
             //启动失败 [需要手动添加回滚到初始状态,重新开始倒计时]
             Blue_Commit::call('Super_Back', $param);
             return array('result' => 3);
         }
     }
     //启动成功
     return array('result' => 4);
 }
Example #4
0
 public function __execute()
 {
     //参数信息过滤
     $data = $this->__verify();
     //数据信息不完整
     if (!($data && count($data) > 0)) {
         return array('result' => 1);
     }
     //获取分类信息
     $numb = $this->sPrize->getGroupCountByGid($data['id']);
     //当前分类已被使用
     if (intval($numb) > 0) {
         return array('result' => 2);
     }
     //删除分类
     try {
         $param = array('id' => intval($data['id']));
         Blue_Commit::call('Super_Prize_Group_Dele', $param);
         return array('result' => 3);
     } catch (Exception $e) {
         //操作失败
         return array('result' => 4);
     }
 }
Example #5
0
 public function __execute()
 {
     //是否需要重新启动
     $reStart = false;
     //参数格式化
     $data = array('id' => $this->__verify());
     //获取奖品详细信息
     $prizeInfo = $this->sPrize->prizeGetByCondition($data);
     //奖品已经结束但未通过FLASH验证则需要跳转到FLASH中做验证
     if (intval($prizeInfo['prize_status']) == 3 && intval($prizeInfo['prize_out']) <= 0) {
         $pid = $this->sEncty->encrypt($data['id'], true);
         $this->redirect('/prize/index/flash?pid=' . $pid);
     }
     //最低人数满足实际人数则启动抽奖(倒计时)自动开奖[系统异常自动处理]
     if (intval($prizeInfo['prize_fact_num']) >= intval($prizeInfo['prize_min_num']) && (intval($prizeInfo['prize_auto']) == 1 || intval($prizeInfo['prize_auto']) == 2 && intval($prizeInfo['prize_start']) == 2) && intval($prizeInfo['prize_fact_num']) > 0) {
         //最后一次投注异常
         if (intval($prizeInfo['prize_start_time']) <= 0) {
             $reStart = true;
         }
         //倒计时中突然关闭浏览器[倒计时未结束]
         if (intval($prizeInfo['prize_start_time']) > 0 && intval($prizeInfo['prize_end_time']) <= 0 && intval($prizeInfo['prize_status']) != 3 && intval($prizeInfo['prize_start_time']) < time()) {
             $reStart = true;
         }
     }
     //重新启动倒计时开奖
     if ($reStart) {
         if (intval($prizeInfo['prize_phase']) > 0) {
             $pahse = intval($prizeInfo['prize_phase']);
         } else {
             $pahse = $this->sPrize->getPrizeMaxPhaseById($data['id']);
             $pahse = $pahse + 1;
         }
         //参数格式化
         $param = array('pid' => $data['id'], 'start' => intval(time() + $prizeInfo['prize_wait_time']), 'pahse' => intval($pahse));
         //自动开奖异常处理
         if (intval($prizeInfo['prize_auto']) == 1 && intval($prizeInfo['prize_start']) == 1) {
             $param['auto'] = 1;
         }
         //手动开奖异常处理
         if (intval($prizeInfo['prize_auto']) == 2 && intval($prizeInfo['prize_start']) == 2) {
             $param['auto'] = 2;
         }
         //异常处理
         try {
             //回滚到初始状态,重新开始倒计时]
             Blue_Commit::call('Super_Back', $param);
             //开始执行倒计时
             Blue_Commit::call('Super_Down', $param);
         } catch (Exception $e) {
             //启动失败 [需要手动添加回滚到初始状态,重新开始倒计时]
             Blue_Commit::call('Super_Back', $param);
         }
         $prizeInfo['start_again'] = 1;
     }
     //根据店铺抽奖限制条件
     if ($prizeInfo && !empty($prizeInfo['prize_agents']) && $prizeInfo['prize_agents'] != 0) {
         //获取相关店铺信息
         $agentList = $this->sAgent->listAgentByIds($prizeInfo['prize_agents']);
         $agentName = '';
         if ($agentList && count($agentList) > 0) {
             foreach ($agentList as $agent) {
                 $agentName .= $agent['agent_name'] . ',';
             }
         }
         if (!empty($agentName)) {
             $agentName = substr($agentName, 0, strlen($agentName) - 1);
             //$agentName = mb_substr($agentName,0,20,'utf-8').'......';
             $prizeInfo['limit_info'] = '本奖品仅限' . $agentName . '的消费会员参与';
         }
     } else {
         if ($prizeInfo && !empty($prizeInfo['prize_locats']) && intval($prizeInfo['prize_locats']) > 0) {
             if (intval($prizeInfo['prize_zone']) > 0) {
                 $zoneInfo = $this->sLocation->listByCondition(array('id' => intval($prizeInfo['prize_zone'])));
             }
             if (intval($prizeInfo['prize_city']) > 0) {
                 $cityInfo = $this->sLocation->listByCondition(array('id' => intval($prizeInfo['prize_city'])));
             }
             if (intval($prizeInfo['prize_disc']) > 0) {
                 $discInfo = $this->sLocation->listByCondition(array('id' => intval($prizeInfo['prize_disc'])));
             }
             $prizeInfo['limit_info'] = '本奖品仅限' . $zoneInfo['title'] . '' . $cityInfo['title'] . '' . $discInfo['title'] . '的消费会员参与';
         } else {
             $prizeInfo['limit_info'] = '本奖品由' . $prizeInfo['prize_company'] . '冠名支持';
         }
     }
     //获取中奖公告信息
     $noticeMsg = '';
     //获取中奖奖品信息
     $recordList = $this->sPrize->getRecordListByStuAndPub(-1, 0, 1, 10);
     if ($recordList && count($recordList) > 0) {
         foreach ($recordList as $record) {
             //获取奖品信息
             $prizeDetail = $this->sPrize->getPrizeInfoByCondition(array('pid' => $record['prize_id']));
             //格式化手机号码
             if (!empty($record['prize_user_mobile']) && strlen($record['prize_user_mobile']) == 11) {
                 $userMobile = substr($record['prize_user_mobile'], 0, 3) . "****" . substr($record['prize_user_mobile'], 7, 4);
                 $user['user_mobile'] = $userMobile;
                 $noticeMsg .= '恭喜' . $userMobile . '中得第' . $prizeDetail['prize_phase'] . '期奖品' . $prizeDetail['prize_title'] . ' ; ';
             }
         }
     }
     //加载中奖人员信息
     $prizeWin = $this->sPrize->getUserInfoById($prizeInfo['prize_win_id']);
     $mobileF = substr($prizeWin['prize_user_mobile'], 0, 3);
     $mobileE = substr($prizeWin['prize_user_mobile'], 7, strlen($prizeWin['prize_user_mobile']));
     $mobileU = $mobileF . '****' . $mobileE;
     $prizeInfo['prize_winmsg'] = '恭喜' . $mobileU . '中得第' . $prizeInfo['prize_phase'] . '期奖品' . $prizeInfo['prize_title'];
     $prizeInfo['notice_info'] = $noticeMsg;
     $prizeInfo['curret_time'] = time();
     $prizeInfo['cstart_time'] = date('Y-m-d H:i:s', $prizeInfo['prize_start_time']);
     $prizeInfo['uid'] = $this->loginInfo['user_info']['users_id'];
     $prizeInfo['rid'] = $this->loginInfo['user_info']['relation_id'];
     $prizeInfo['mid'] = $this->loginInfo['user_info']['member_id'];
     $prizeInfo['pid'] = $this->sEncty->encrypt($data['id'], true);
     $prizeInfo['url'] = 'http://www.xabaili.com/includes/phpqrcode.php?url=' . urlencode('http://m.xabaili.com/prize/index.php?pid=' . $data['id'] . '&size=8');
     //返回并输出结果信息
     return array('id' => intval(trim($_GET['id'])), 'item' => $prizeInfo);
 }
Example #6
0
 public function __execute()
 {
     //验证数据信息
     $data = $this->__verify();
     //数据信息有误
     if (intval($data['pid']) > 0) {
         //获取超级大奖信息
         $prizeInfo = $this->sPrize->getPrizeInfoById($data['pid']);
         $usersInfo = $this->sPrize->getUserInfoById($prizeInfo['prize_win_id']);
         $endTime = intval($prizeInfo['prize_start_time'] + $prizeInfo['prize_wait_time'] + $prizeInfo['prize_buffer_time']);
         try {
             //启动倒计时
             $param = array('pid' => $data['pid']);
             Blue_Commit::call('Super_Mark', $param);
             //消息信息
             $string = '';
             if ($prizeInfo && !empty($prizeInfo['prize_code'])) {
                 switch (intval($prizeInfo['prize_status'])) {
                     case 0:
                         $prizeStatus = '待开放';
                         break;
                     case 1:
                         $prizeStatus = '进行中';
                         break;
                     case 3:
                         $prizeStatus = '已结束';
                         break;
                     case 4:
                         $prizeStatus = '已隐藏';
                         break;
                     default:
                         $prize_status = '未知态';
                         break;
                 }
                 switch (intval($prizeInfo['prize_auto'])) {
                     case 1:
                         $prizeAuto = '自动';
                         break;
                     case 2:
                         $prizeAuto = '手动';
                         break;
                 }
                 $string .= '<div style="margin-left:auto;margin-right:auto;font-size:12px;color:green;">';
                 $string .= '<p>===来自' . $usersInfo['prize_user_ip'] . '的中奖信息===</p>';
                 $string .= '<p><img src="' . $prizeInfo['prize_picture'] . '" width="225px" height="225px"/></p>';
                 $string .= '<p>===奖品编号:' . $prizeInfo['prize_code'] . '===</p>';
                 $string .= '<p>===奖品名称:' . $prizeInfo['prize_title'] . '===</p>';
                 $string .= '<p>===奖品期数:' . $prizeInfo['prize_phase'] . '===</p>';
                 $string .= '<p>===奖品价格:' . $prizeInfo['prize_price'] . '===</p>';
                 $string .= '<p>===奖品积分:' . $prizeInfo['prize_currency'] . '===</p>';
                 $string .= '<p>===投注积分:' . $prizeInfo['prize_draw_currency'] . '===</p>';
                 $string .= '<p>===启动人数:' . $prizeInfo['prize_min_num'] . '===</p>';
                 $string .= '<p>===实际人数:' . $prizeInfo['prize_fact_num'] . '===</p>';
                 $string .= '<p>===奖品状态:' . $prizeStatus . '===</p>';
                 $string .= '<p>===开奖模式:' . $prizeAuto . '===</p>';
                 if ($prizeInfo['prize_agents'] != 0 && !empty($prizeInfo['prize_agents'])) {
                     $pid = $this->sAgent->getPidByAid($prizeInfo['prize_agents']);
                     $agentName = $this->sAgent->getNameByPid($pid);
                     $storeName = $this->sAgent->getAgentNamesByAids($prizeInfo['prize_agents']);
                     $string .= '<p>===冠名店铺:' . $storeName . '===</p>';
                     $string .= '<p>===启动商家:' . $agentName . '===</p>';
                 } else {
                     if ($prizeInfo['prize_aid'] >= 0 && !empty($prizeInfo['prize_aid'])) {
                         $agentName = $this->sAgent->getNameByPid($prizeInfo['prize_aid']);
                         $string .= '<p>===启动商家:' . $agentName + '===</p>';
                     } else {
                         $string .= '<p>===冠名企业:百利自营===</p>';
                     }
                 }
                 $string .= '<p>===新增日期:' . date('Y-m-d H:i:s', $prizeInfo['prize_add_date']) . '===</p>';
                 $string .= '<p>===编辑日期:' . date('Y-m-d H:i:s', $prizeInfo['prize_mod_date']) . '===</p>';
                 $string .= '<p>===启动日期:' . date('Y-m-d H:i:s', $prizeInfo['prize_start_time']) . '===</p>';
                 $string .= '<p>===结束日期:' . date('Y-m-d H:i:s', $endTime) . '===</p>';
                 if ($usersInfo['prize_user_name'] != $usersInfo['prize_user_mobile']) {
                     $string .= '<p>===中奖会员:' . $usersInfo['prize_user_name'] . '===</p>';
                 }
                 $string .= '<p>===中奖电话:' . $usersInfo['prize_user_mobile'] . '===</p>';
                 if ($usersInfo['prize_user_card'] != '' && $usersInfo['prize_user_card'] != null && (strlen($usersInfo['prize_user_card']) == 15 || strlen($usersInfo['prize_user_card']) == 18)) {
                     $string .= '<p>===中奖身份:' . $usersInfo['prize_user_card'] . '===</p>';
                 }
                 $string .= '<p>===中奖省份:' . $usersInfo['prize_user_province'] . '===</p>';
                 $string .= '<p>===中奖城市:' . $usersInfo['prize_user_city'] . '===</p>';
                 $string .= '<p>===中奖区县:' . $usersInfo['prize_user_district'] . '===</p>';
                 $string .= '<p>===来自:' . $_SERVER['SERVER_ADDR'] . '的系统信息===</p>';
                 $string .= '<p>===系统服务:' . $_SERVER['SERVER_SOFTWARE'] . '===</p>';
                 $string .= '<br/>';
                 $string .= '</div>';
                 $string .= "\t\n";
             }
             //发送邮件
             if (!empty($string)) {
                 $this->aEmial->sendEmail('超级大奖电子邮件!', $string);
             }
         } catch (Exception $e) {
             //操作失败
             $this->aEmial->sendEmail('超级大奖电子邮件!', $prizeInfo['prize_code'] . '标记失败!');
             return array('result' => 0);
         }
         return array('result' => 1);
     }
     return array('result' => 2);
 }