Example #1
0
 }
 /*ccx 2014-12-26 */
 // 判断是否已经抽奖过了的  本次登陆抽奖活动的固定设置为 2015010002
 /*ccx 2014-12-26 判断该用户是否已经抽奖过 开始*/
 $luck_count_sql = "SELECT COUNT(*) FROM " . $ecs->table('lucky_draw') . " WHERE user_id = {$user_id} AND activity_code = '2015010002' ";
 $luck_count = $db->getOne($luck_count_sql);
 if ($luck_count > 0) {
     $ak['msg'] = '您这个账号已经参与过本次抽奖活动了,不能再进行抽奖了,谢谢合作!';
     echo $value = json_encode($ak);
     exit;
 }
 /*ccx 2014-12-26 是否抽奖 结束*/
 /* ccx 2014-12-26 统计该活动参与抽奖的人数 */
 $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('lucky_draw') . " WHERE activity_code ='2015010002'");
 $record_number = ($record_count + 1) % 100 + 0;
 $arr_return_info = lucky_draw_mesaage($record_number, $user_id);
 if (!$arr_return_info['success'] || !in_array($arr_return_info['type_money'], array(10, 20, 30, 50))) {
     $ak['msg'] = $arr_return_info['message'];
     echo $value = json_encode($ak);
     exit;
 }
 $ak = array('int_lottery_result' => KA_LOTTERY_AWARD_1, 'int_lottery_stat' => KA_LOTTERY_STATUS_YES, 'int_lottery_win' => KA_LOTTERY_STATUS_YES, 'award' => '', 'msg' => $arr_return_info['message']);
 if ($arr_return_info['type_money'] == 10) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_1;
 } elseif ($arr_return_info['type_money'] == 20) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_2;
 } elseif ($arr_return_info['type_money'] == 30) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_3;
 } elseif ($arr_return_info['type_money'] == 50) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_4;
 }
Example #2
0
     exit;
 }
 /* ccx 2014-12-15 获取订单活动代码 结束 */
 /*ccx 2014-12-13 判断这个订单是否已经参与过抽奖了,如果参与过抽奖的订单,就不允许再次参与抽奖了 开始*/
 $luck_order_sn = "SELECT COUNT(*) FROM " . $ecs->table('lucky_draw') . " WHERE order_sn = '" . $order_sn . "' AND activity_code ='" . $activity_code['activity_code'] . "'";
 $luck_order_sn_count = $db->getOne($luck_order_sn);
 if ($luck_order_sn_count > 0) {
     $ak['msg'] = '您的订单已经抽过奖了,不能再进行抽奖了,谢谢合作!';
     echo $value = json_encode($ak);
     //echo iconv("GB2312","UTF-8",'您的订单已经抽过奖了,不能再进行抽奖了,谢谢合作');
     exit;
 }
 /*ccx 2014-12-13 判断这个订单是否已经参与过抽奖了,如果参与过抽奖的订单,就不允许再次参与抽奖了 结束*/
 $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('lucky_draw') . " WHERE activity_code ='" . $activity_code['activity_code'] . "'");
 $record_number = ($record_count + 1) % 100 + 0;
 $arr_return_info = lucky_draw_mesaage($record_number, $order_id, $user_id, $payprice);
 if (!$arr_return_info['success'] || !in_array($arr_return_info['type_money'], array(10, 20, 30, 50))) {
     $ak['msg'] = $arr_return_info['message'];
     echo $value = json_encode($ak);
     exit;
 }
 $ak = array('int_lottery_result' => KA_LOTTERY_AWARD_1, 'int_lottery_stat' => KA_LOTTERY_STATUS_YES, 'int_lottery_win' => KA_LOTTERY_STATUS_YES, 'award' => '', 'msg' => $arr_return_info['message']);
 if ($arr_return_info['type_money'] == 10) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_1;
 } elseif ($arr_return_info['type_money'] == 20) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_2;
 } elseif ($arr_return_info['type_money'] == 30) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_3;
 } elseif ($arr_return_info['type_money'] == 50) {
     $ak['int_lottery_result'] = KA_LOTTERY_AWARD_4;
 }