本文整理汇总了PHP中Quote::find_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Quote::find_all方法的具体用法?PHP Quote::find_all怎么用?PHP Quote::find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quote
的用法示例。
在下文中一共展示了Quote::find_all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quotazione
function quotazione()
{
$conn = $this->get_connection();
$quote = new Quote();
$quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($_GET['isin'])}' ", 'order_by' => '`data` DESC, `ora` DESC ', 'limit' => 1));
$quotazione = $quotes[0]->quotazione;
die('({quotazione:' . $quotazione . '})');
}
示例2: index
function index()
{
$conn = $this->get_connection();
$dividend_factory = new Dividend();
//set_default_dir('up');
$this->dividends = $dividend_factory->find_by_query('SELECT `creso_dividendi`.`id`, `creso_dividendi`.`stacco`, `creso_dividendi`.`importo`, `creso_dividendi`.`isin`, `creso_titoli`.`title` ' . 'FROM `creso_dividendi` ' . 'LEFT JOIN `creso_titoli` ON `creso_dividendi`.`isin` = `creso_titoli`.`isin` ' . "WHERE 1 " . (!empty($_REQUEST['mercato']) ? "AND `mercato` = '{$conn->escape($_REQUEST['mercato'])}' " : '') . (!empty($_REQUEST['tipo']) ? "AND `tipo` = '{$conn->escape($_REQUEST['tipo'])}' " : '') . (!empty($_REQUEST['from']) ? "AND `stacco` >= '{$conn->escape($_REQUEST['from'])}' " : '') . (!empty($_REQUEST['to']) ? "AND `stacco` <= '{$conn->escape($_REQUEST['to'])}' " : '') . 'ORDER BY ' . sprintf('`%s` %s ', $this->get_sort('stacco'), $this->get_dir()) . "LIMIT {$conn->escape($this->get_start())}, {$conn->escape($this->get_limit())}");
if (count($this->dividends) > 0) {
foreach ($this->dividends as $dividend) {
$dividend->stock = new Stock();
$dividend->stock->find_by_id($dividend->isin);
$quote = new Quote();
$quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($dividend->isin)}' ", 'order_by' => '`data` DESC, `ora` DESC', 'limit' => 1));
$dividend->quote = $quotes[0];
}
}
}
示例3: index
function index()
{
$conn = $this->get_connection();
$item_factory = new WatchlistItem();
$this->items = $item_factory->find_all(array('where_clause' => "`utente` = '{$conn->escape($_COOKIE['username'])}' ", 'order_by' => sprintf('`%s` %s', $this->get_sort('isin'), $this->get_dir()), 'limit' => $this->get_limit()));
if (count($this->items) > 0) {
foreach ($this->items as $item) {
$item->stock = new Stock();
$item->stock->find_by_id($item->isin);
$quote = new Quote();
$quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($item->isin)}' ", 'order_by' => '`data` DESC, `ora` DESC', 'limit' => 1));
$item->quote = $quotes[0];
$quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($item->isin)}' " . "AND `data` >= '{$conn->escape(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)))}' " . 'ORDER BY `quotazione` DESC ' . 'LIMIT 1');
$item->max_quote = $quotes[0];
$quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($item->isin)}' " . "AND `data` >= '{$conn->escape(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)))}' " . 'ORDER BY `quotazione` ASC ' . 'LIMIT 1');
$item->min_quote = $quotes[0];
}
}
}
示例4: synthesize_portfolio_stocks
private function synthesize_portfolio_stocks()
{
$conn = $this->get_connection();
$quote_factory = new Quote();
$quote = $quote_factory->find_all(array('where_clause' => "`isin` = '{$conn->escape($_REQUEST['isin'])}' " . "AND `data` <= '{$conn->escape(date('Y-m-d'))}'", 'order_by' => '`data` DESC', 'limit' => 1))[0];
$portfolio_stock = new PortfolioStock(array('isin' => $_REQUEST['isin'], 'quantita' => 1000));
$portfolio_stock->prezzo = $quote->quotazione;
$portfolio_stocks[] = $portfolio_stock;
return $portfolio_stocks;
}
示例5: roi
function roi()
{
$conn = $this->get_connection();
$stock_factory = new PortfolioStock();
$portfolio_stocks = $stock_factory->find_all(array('where_clause' => "`utente` = '{$conn->escape($_COOKIE['username'])}' AND `isin` = '{$conn->escape($_GET['id'])}'"));
$this->stock = $portfolio_stocks[0];
$this->stock->stock = new Stock();
$this->stock->stock->find_by_id($this->stock->isin);
$quote = new Quote();
$quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($this->stock->isin)}' ", 'order_by' => '`data` DESC, `ora` DESC', 'limit' => 1));
$this->stock->quote = $quotes[0];
$this->render(array('layout' => 'portfolio_roi'));
}