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


PHP Quote::find_by_query方法代码示例

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


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

示例1: Quote

 function _min_max($date)
 {
     $conn = $this->get_connection();
     $quote = new Quote();
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($_GET['isin'])}' " . "AND `data` >= '{$conn->escape($date)}' " . 'ORDER BY `quotazione` DESC ' . 'LIMIT 1');
     $max_quote = $quotes[0]->quotazione;
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($_GET['isin'])}' " . "AND `data` >= '{$conn->escape($date)}' " . 'ORDER BY `quotazione` ASC ' . 'LIMIT 1');
     $min_quote = $quotes[0]->quotazione;
     die('({min:' . $min_quote . ',max:' . $max_quote . '})');
 }
开发者ID:emeraldion,项目名称:creso,代码行数:10,代码来源:json_controller.php

示例2: for_range_and_order

 public static function for_range_and_order($isin, $date_from, $date_to, $order_by, $sort_dir)
 {
     $conn = Db::get_connection();
     $quote = new Quote();
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($isin)}' " . "AND `data` > '{$conn->escape($date_from)}' " . "AND `data` < '{$conn->escape($date_to)}' " . "ORDER BY `{$conn->escape($order_by)}` {$conn->escape(strtoupper($sort_dir))} " . 'LIMIT 1');
     // print_r($quotes);
     Db::close_connection($conn);
     return $quotes[0];
 }
开发者ID:emeraldion,项目名称:creso,代码行数:9,代码来源:quote_helper.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: inspect

 /**
  *  @fn inspect
  *  @short Inspects an instrument
  *  @details Action to inspect an instrument, used internally by #browse to
  *  render the main view.
  */
 public function inspect()
 {
     $conn = $this->get_connection();
     $isin = isset($_REQUEST['id']) ? $_REQUEST['id'] : $_REQUEST['isin'];
     $this->stock = new Stock();
     $this->stock->find_by_id($isin);
     $yesterday = date('Y-m-d', mktime(0, 0, 0, isset($_REQUEST['month']) ? $_REQUEST['month'] : date('m'), (isset($_REQUEST['day']) ? $_REQUEST['day'] : date('d')) - 1, isset($_REQUEST['year']) ? $_REQUEST['year'] : date('Y')));
     $tomorrow = date('Y-m-d', mktime(0, 0, 0, isset($_REQUEST['month']) ? $_REQUEST['month'] : date('m'), (isset($_REQUEST['day']) ? $_REQUEST['day'] : date('d')) + 1, isset($_REQUEST['year']) ? $_REQUEST['year'] : date('Y')));
     $quote = new Quote();
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($this->stock->isin)}' " . "AND `data` > '{$conn->escape($yesterday)}' " . "AND `data` < '{$conn->escape($tomorrow)}' " . 'ORDER BY `quotazione` DESC ' . 'LIMIT 1');
     $this->stock->day_max = count($quotes) > 0 ? $quotes[0] : $quote;
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($this->stock->isin)}' " . "AND `data` > '{$conn->escape($yesterday)}' " . "AND `data` < '{$conn->escape($tomorrow)}' " . 'ORDER BY `quotazione` ASC ' . 'LIMIT 1');
     $this->stock->day_min = count($quotes) > 0 ? $quotes[0] : $quote;
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($this->stock->isin)}' " . "AND `data` > '{$conn->escape($yesterday)}' " . "AND `data` < '{$conn->escape($tomorrow)}' " . 'ORDER BY `data` ASC, `ora` ASC ' . 'LIMIT 1');
     $this->stock->open = count($quotes) > 0 ? $quotes[0] : $quote;
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($this->stock->isin)}' " . "AND `data` > '{$conn->escape($yesterday)}' " . "AND `data` < '{$conn->escape($tomorrow)}' " . 'ORDER BY `data` DESC, `ora` DESC ' . 'LIMIT 1');
     $this->stock->last = count($quotes) > 0 ? $quotes[0] : $quote;
 }
开发者ID:emeraldion,项目名称:creso,代码行数:24,代码来源:titoli_controller.php


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