当前位置: 首页>>代码示例>>PHP>>正文


PHP Contract::find_by_sql方法代码示例

本文整理汇总了PHP中Contract::find_by_sql方法的典型用法代码示例。如果您正苦于以下问题:PHP Contract::find_by_sql方法的具体用法?PHP Contract::find_by_sql怎么用?PHP Contract::find_by_sql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contract的用法示例。


在下文中一共展示了Contract::find_by_sql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: find_contract_team

 public function find_contract_team()
 {
     $conts = Contract::find_by_sql("SELECT * FROM contracts WHERE player={$this->id} AND expiry>" . time() . " AND term=0 ORDER BY date_of_reg DESC");
     if (isset($conts)) {
         return Team::find_by_id($conts[0]->team);
     } else {
         return NULL;
     }
 }
开发者ID:kunal-bajpai,项目名称:gfa,代码行数:9,代码来源:player.php

示例2: Visa

        $newIns->save();
    }
    if (isset($_POST['visaTo'])) {
        $newVisa = new Visa();
        $newVisa->set($_GET['id'], strtotime($_POST['visaTo']));
        $newVisa->save();
    }
    if (isset($_POST['transFrom'])) {
        $newTrans = new Transfer();
        $newTrans->set($_GET['id'], $_POST['assoc'], strtotime($_POST['transFrom']));
        $newTrans->save();
    }
    $teams = Team::find_all();
    $assocs = Assoc::find_all();
    if ($player->category == 1) {
        $contracts = Contract::find_by_sql("SELECT * FROM contracts WHERE player={$player->id} ORDER BY date_of_reg ASC");
        $insurances = Insurance::find_by_sql("SELECT * FROM insurances WHERE player={$player->id} ORDER BY added_on ASC");
        $visas = Visa::find_by_sql("SELECT * FROM visas WHERE player={$player->id} ORDER BY added_on ASC");
        $loans = Loan::find_by_sql("SELECT * FROM loans WHERE player={$player->id} ORDER BY start ASC");
        $transfers = Transfer::find_by_sql("SELECT * FROM transfers WHERE player={$player->id} ORDER BY start ASC");
        $contractTeam = $player->find_contract_team();
        $currentTeam = $player->find_current_team();
        $transTo = Assoc::find_by_sql("SELECT * FROM assocs WHERE id = (SELECT assoc FROM transfers WHERE player = {$_GET['id']} AND returned = 0)");
    }
}
?>
<html>
<head>
	<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
	<meta charset="UTF-8">
	<title> Goa FA | Search</title>
开发者ID:kunal-bajpai,项目名称:gfa,代码行数:31,代码来源:playerView.php


注:本文中的Contract::find_by_sql方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。