本文整理汇总了PHP中Flight::aod方法的典型用法代码示例。如果您正苦于以下问题:PHP Flight::aod方法的具体用法?PHP Flight::aod怎么用?PHP Flight::aod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flight
的用法示例。
在下文中一共展示了Flight::aod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findByDivision
public static function findByDivision($game_id, $limit = false)
{
if (!$limit) {
$limit = 10;
}
return arrayToObject(Flight::aod()->from(self::$table)->where(array("member.game_id" => $game_id))->limit($limit)->sortDesc('date')->join('actions', array('actions.id' => 'user_actions.type_id'))->join('member', array('member.member_id' => 'user_actions.target_id'))->select(array('date', 'user_id', 'type_id', 'target_id', 'verbage', 'icon'))->many());
}
示例2: delete
public static function delete($id)
{
$pt = self::find(array('id' => $id));
if (count($pt)) {
Flight::aod()->remove($pt);
}
return (bool) Flight::aod()->affected_rows;
}
示例3: findSquadMembers
public static function findSquadMembers($squad_id, $div_struc_sort = false, $recruiter = false)
{
$conditions = $recruiter ? array('squad_id' => $squad_id, 'position_id' => 6, 'recruiter !%' => $recruiter, 'status_id @' => array(1, 3, 999)) : array('squad_id' => $squad_id, 'position_id' => 6, 'status_id @' => array(1, 3, 999));
if ($div_struc_sort) {
return Flight::aod()->from(Member::$table)->where($conditions)->sortDesc('rank_id')->sortAsc('forum_name')->many();
} else {
return Flight::aod()->from(Member::$table)->where($conditions)->sortAsc('last_activity')->many();
}
}
示例4: findHandle
public static function findHandle($member_id, $type)
{
$params = Flight::aod()->using('MemberHandle')->where(array('member_id' => $member_id, 'handle_type' => $type))->find();
if (is_object($params)) {
$handle = Handle::findByType($params->handle_type);
$params->handle_name = $handle->type;
$params->name = $handle->name;
$params->isInvalid = (bool) $params->invalid;
$params->isVisible = (bool) $handle->show_on_profile;
if (!is_null($handle->url)) {
$params->url = $handle->url;
}
}
return $params;
}
示例5: _doBattlelogIdUpdate
function _doBattlelogIdUpdate()
{
$members = array();
$battlelog_names = objectToArray(Member::find(array('status_id' => 1, 'battlelog_name !%' => 0, 'battlelog_id' => 0)));
$countNames = count($battlelog_names);
echo "Fetched battlelog names. ({$countNames})<br /><br />";
foreach ($battlelog_names as $row) {
$battlelog_id = Member::getBattlelogId($row['battlelog_name']);
if (!$battlelog_id['error']) {
$sql = "UPDATE member SET battlelog_id = {$battlelog_id['id']} WHERE battlelog_name = '{$row['battlelog_name']}'";
Flight::aod()->sql($sql)->one();
echo "Added ID {$battlelog_id['id']} to {$row['battlelog_name']}<br />";
} else {
echo "ERROR: {$row['battlelog_name']} - {$battlelog_id['message']}<br />";
}
}
echo "done syncing battlelog ids.";
}
示例6: remove
public static function remove($member_id)
{
$flag = self::find(array('member_id' => $member_id));
Flight::aod()->remove($flag);
}
示例7: findAll
public static function findAll($game_id)
{
return Flight::aod()->using('RecruitingTask')->where(array('game_id @' => array(0, $game_id)))->sortDesc('game_id')->sortAsc('sort_order')->find();
}
示例8: modify
public static function modify($params)
{
$member = new self();
foreach ($params as $key => $value) {
$member->{$key} = $value;
}
$member->update($params);
return Flight::aod()->affected_rows;
}
示例9: resetValidation
public static function resetValidation($email)
{
$user = self::find(array('email' => $email));
if (empty($user)) {
return false;
} else {
$user->validation = md5(time() . rand());
$user->validated = 0;
Flight::aod()->save($user);
Email::validate($user);
return true;
}
}
示例10: recruitingByTheMonth
public static function recruitingByTheMonth($game_id)
{
$sql = "SELECT DATE(DATE_FORMAT(date, '%Y-%m-01')) AS month_beginning, count( * ) AS count\n\t\t\t\tFROM user_actions\n\t\t\t\tJOIN member ON member.member_id = user_actions.user_id\n\t\t\t\tWHERE member.game_id = {$game_id}\n\t\t\t\tAND date > DATE_SUB(NOW(), INTERVAL 4 MONTH)\n\t\t\t\tAND type_id = 1\n\t\t\t\tGROUP BY DATE(DATE_FORMAT(date, '%Y-%m-01'))\n\t\t\t\tORDER BY DATE(DATE_FORMAT(date, '%Y-%m-01'))";
$params = Flight::aod()->sql($sql)->many();
return objectToArray($params);
}
示例11: findByName
public static function findByName($name, $game_id)
{
$data = Flight::aod()->using('RecruitingString');
return $data->find(['name' => $name, 'game_id' => $game_id]);
}
示例12: delete
public static function delete($id)
{
$pt = self::find($id);
Flight::aod()->remove($pt);
}
示例13: foreach
echo $js;
?>
.js"></script>
<?php
}
if (!empty($extrajs) && is_array($extrajs)) {
foreach ($extrajs as $js) {
if (isset($js) && file_exists("assets/js/{$js}.js")) {
?>
<script src="assets/js/<?php
echo $js;
?>
.js"></script>
<?php
}
}
}
?>
<?php
// debug information
if (isset($_SESSION['userid'])) {
Flight::aod()->show_sql = true;
error_reporting(E_ALL);
ini_set('display_errors', '1');
}
?>
</body>
</html>
示例14: get_number_from_id
public static function get_number_from_id($platoon_id)
{
$sql = "SELECT number FROM " . Platoon::$table . " WHERE id = {$platoon_id}";
$params = Flight::aod()->sql($sql)->one();
return $params['number'];
}
示例15: find_all
/**
* fetch all alerts not seen by user
* @return array array of alerts
*/
public static function find_all($user)
{
$sql = "SELECT DISTINCT * FROM " . self::$table . " WHERE start_date < CURRENT_TIMESTAMP AND end_date > CURRENT_TIMESTAMP AND NOT EXISTS ( SELECT * FROM " . AlertStatus::$table . " WHERE alert_id = alerts.id AND user_id = {$user} )";
$params = Flight::aod()->sql($sql)->many();
return arrayToObject($params);
}