예제 #1
0
    $act["active"] = 6;
} else {
    $act["pass"] = 6;
    $act["active"] = 7;
}
$tpl->act = $act;
$tpl->data = $data;
include_once "../library/Table/Coupon.class.php";
$coupon = new Coupon();
$getcoupon = $coupon->getByRandCoupon();
$tpl->getcoupon = $getcoupon;
include_once "../library/Table/Lottery.class.php";
$lottery = new Lottery();
//以下是計算USER有無領過獎
//  date_default_timezone_set("Asia/Taipei");
// $today = date("Y-m-d");
// $today = (str)$today;
// print_r($today);
$lotteryfail = $lottery->getByLotteryFbId($_SESSION['fbId']);
$tpl->lotteryfail = $lotteryfail;
//以下是計算USER當日有無在被領100次以外
//countLotteryByDate
$todaylotteryfailtimes = $lottery->countLotteryByDate($today);
$tpl->todaylotteryfailtimes = $todaylotteryfailtimes;
//判斷該FB_ID有沒有填寫過表單,有填寫過的話則直接導頁
$ishavedata = $lottery->countLotteryFbid($_SESSION['fbId']);
$tpl->ishavedata = $ishavedata;
//print_r($ishavedata);
//取出該FB_ID的EMAIL
$getEmail = $lottery->getByLotteryEmail($_SESSION['fbId']);
$tpl->getemail = $getEmail;
예제 #2
0
            $inviteAry = array();
            $listInviteFriend = $logInviteFriend->listInviteFriend();
            if (!empty($listInviteFriend) && is_array($listInviteFriend)) {
                foreach ($listInviteFriend as $value) {
                    $inviteAry[] = $value['friend_id'];
                }
                // 名單比對
                $intersectAry = array_intersect($userAry, $inviteAry);
                $tempRow["count_invite_friend_enter"] = count($intersectAry);
            } else {
                $tempRow["count_invite_friend_enter"] = 0;
            }
        } else {
            $tempRow["count_invite_friend_enter"] = 0;
        }
        /*
        $listInviteFriendEnter = $logInviteFriend->listFriendEnterGameByDate($tempRow['log_date']);
        if (is_array($listInviteFriendEnter)) {
            $tempRow["count_invite_friend_enter"] = count($listInviteFriendEnter);
        } else {
            $tempRow["count_invite_friend_enter"] = 0;
        }
        */
        // 參加抽獎人數
        $countLottery = $tbLottery->countLotteryByDate($tempRow['log_date']);
        $tempRow["count_lottery"] = $countLottery;
        // 塞回陣列中
        $result_log[$key] = $tempRow;
    }
}
$tpl->list = $result_log;