本文整理汇总了PHP中JDate::getSunday方法的典型用法代码示例。如果您正苦于以下问题:PHP JDate::getSunday方法的具体用法?PHP JDate::getSunday怎么用?PHP JDate::getSunday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JDate
的用法示例。
在下文中一共展示了JDate::getSunday方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVeckoVinnare
/**
* Gets winners
* Krillo 2012-09-10
*
* @global $db $db
* @param type $date a date in the selected week
* @param type $antal_medlemmar return this nbr of winners
* @param type $antal_steg min nbr of steps to attend
* @param type $foretagList select only from these companys
* @param type $prevWinners select also from previous winners
* @return type
*/
public static function getVeckoVinnare($date, $antal_medlemmar, $antal_steg, $foretagList, $prevWinners)
{
global $db;
$jDate = new JDate($date);
$monday = $jDate->getMonday();
$sunday = $jDate->getSunday();
if ($prevWinners) {
$prev = ' ';
} else {
$prev = " AND a.veckotavling_status = 0 ";
}
$sql = "SELECT a.id, a.epost, a.aNamn, a.fNamn, a.eNamn, a.levelId, a.paidUntil, a.veckotavling_status, a.veckotavling_week, a.veckotavling_datum, a.veckotavling_price_text, SUM(steg) as steg, f.namn AS companyname, f.startdatum, f.slutdatum \n FROM mm_medlem a, mm_steg b, mm_foretagsnycklar n, mm_foretag f \n\t\t\tWHERE a.id = n.medlem_id \n AND n.foretag_id IN ({$foretagList}) \n AND n.foretag_id = f.id\n {$prev} \n AND a.id = b.medlem_id \n\t\t\tAND b.datum >= '" . $monday . "' \n\t\t\tAND b.datum <= '" . $sunday . "' \n GROUP BY a.id \n HAVING SUM(steg) >= '" . $antal_steg . "' ";
//echo "<br>" . $sql;
$medlemmar = $db->allValuesAsArray($sql);
//print_r($medlemmar);
if (count($medlemmar) > $antal_medlemmar) {
$medlemmar = Misc::shuffle_assoc($medlemmar, 0);
$medlemmar = array_slice($medlemmar, 0, $antal_medlemmar);
}
return Misc::shuffle_assoc($medlemmar, 0);
}