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


PHP Quote::find_all方法代码示例

本文整理汇总了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 . '})');
 }
开发者ID:emeraldion,项目名称:creso,代码行数:8,代码来源:json_controller.php

示例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];
         }
     }
 }
开发者ID:emeraldion,项目名称:creso,代码行数:16,代码来源:dividendi_controller.php

示例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];
         }
     }
 }
开发者ID:emeraldion,项目名称:creso,代码行数:19,代码来源:watchlist_controller.php

示例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;
 }
开发者ID:emeraldion,项目名称:creso,代码行数:10,代码来源:pagamenti_controller.php

示例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'));
 }
开发者ID:emeraldion,项目名称:creso,代码行数:13,代码来源:portfolio_controller.php


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