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


PHP dibi::dataSource方法代码示例

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


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

示例1: getDatasourceGroupByKey

 static function getDatasourceGroupByKey()
 {
     $sql = '';
     $langs = self::getAll();
     foreach ($langs as $l) {
         $sql .= '(SELECT translate FROM [lang_translate] WHERE [main].[key] = [lang_translate].[key] AND id_lang = ' . $l['id_lang'] . ') AS ' . $l['iso'] . ',';
     }
     return dibi::dataSource("\n\t\t\tSELECT\n\t\t\t\t" . $sql . "\n\t\t\t\t[key]\n\t\t\tFROM\n\t\t\t\t[lang_translate] main\n\t\t\tGROUP BY [key]");
 }
开发者ID:oaki,项目名称:demoshop,代码行数:9,代码来源:LangModel.php

示例2: getItem

 public static function getItem($source, $id)
 {
     $result = dibi::dataSource('SELECT * FROM %n WHERE id = %i', $source, $id);
     $data = $result->fetchAll();
     if (count($data) > 0) {
         return $data[0];
     } else {
         return null;
     }
 }
开发者ID:jaroslavlibal,项目名称:MDW,代码行数:10,代码来源:BaseModel.php

示例3: showLog

 function showLog()
 {
     $session = NEnvironment::getSession('Log');
     if (isset($_GET['order_by'])) {
         if ($_GET['order_by'] != "date" and $_GET['order_by'] != "id_user" and $_GET['order_by'] != "description" and $_GET['order_by'] != "value" and $_GET['order_by'] != "value" and $_GET['order_by'] != "id_type_modul" and $_GET['order_by'] != "ip") {
             $session['log_order_by'] = "date";
         } else {
             $session['log_order_by'] = $_GET['order_by'];
         }
     }
     if (!isset($session['log_order_by'])) {
         $session['log_order_by'] = "date";
     }
     $source = dibi::dataSource("\n\t\t\tSELECT log.*, user.login  \n\t\t\tFROM log LEFT JOIN user USING(id_user) \n\t\t\tWHERE\n\t\t\t\t%if", @$_GET['input_id_user'] != '', "login LIKE %s", '%' . @$_GET['input_id_user'] . '%', " AND %end\n\t\t      \t%if", @$_GET['input_date'] != '', "[date] > %s", @$_GET['input_date'], " AND %end\n\t\t\t    %if", @$_GET['input_description'] != '', "description LIKE %s", '%' . @$_GET['input_description'] . '%', " AND %end\n\t\t\t    %if", @$_GET['input_value'] != '', "value LIKE %s", '%' . @$_GET['input_value'] . '%', " AND %end\n\t\t\t    %if", @$_GET['input_id_type_modul'] != '', "name_modul LIKE %s", '%' . @$_GET['input_id_type_modul'] . '%', " AND %end\n\t\t\t    ip LIKE %s", '%' . @$_GET['input_ip'] . '%', " \n\t\t    \n\t\t    ORDER BY " . $session['log_order_by'] . " DESC");
     $p = new MyPaginator($source);
     MT::addTemplate(dirname(__FILE__) . '/log.phtml', 'log');
     MT::addVar('log', 'paginator', $p);
     MT::addVar('log', 'list', $p->getDataSourceItem()->fetchAll());
 }
开发者ID:oaki,项目名称:demoshop,代码行数:19,代码来源:log_class.php

示例4: getDataSource

 function getDataSource()
 {
     return dibi::dataSource("SELECT * FROM log");
 }
开发者ID:oaki,项目名称:demoshop,代码行数:4,代码来源:LogModel.php

示例5: getClosedTickets

 public static function getClosedTickets($id)
 {
     $rowset = dibi::dataSource('SELECT id, ticketId, priority, name, subject, status, updated FROM ticket WHERE (departmentId=%i) AND (closed=%i) ORDER BY updated DESC', $id, 1);
     return $rowset;
 }
开发者ID:jaroslavlibal,项目名称:MDW,代码行数:5,代码来源:TicketsModel.php

示例6: getUsers

 public static function getUsers()
 {
     $rowset = dibi::dataSource('SELECT * FROM user');
     return $rowset;
 }
开发者ID:jaroslavlibal,项目名称:MDW,代码行数:5,代码来源:UsersModel.php

示例7: getDatasource

 static function getDatasource()
 {
     return dibi::dataSource("SELECT * FROM [" . TABLE_USERS . "]");
 }
开发者ID:oaki,项目名称:demoshop,代码行数:4,代码来源:UserModel.php

示例8: getTreeCheckProduct

 static function getTreeCheckProduct($id_product = null)
 {
     return dibi::dataSource("\n\t\t\tSELECT\n\t\t\t*, id_category AS id\n\t\t\t%if", $id_product, "\n\t\t\t\t,\n\t\t\tIF (\n\t\t\t\t(SELECT\n\t\t\t\t1\n\t\t\t\tFROM\n\t\t\t\t[category_product]\n\t\t\t\tWHERE\n\t\t\t\tid_product = %i", $id_product, "AND category_product.id_category = id LIMIT 1) = 1,\n\t\t\t\t1,\n\t\t\t\t0\n\t\t\t) AS cb\n\t\t\t%end\n\t\t\tFROM\n\t\t\t[category]\n\t\t\tLEFT JOIN [category_lang] USING(id_category)\n\n\n\t\t");
 }
开发者ID:oaki,项目名称:demoshop,代码行数:4,代码来源:CategoryModel.php

示例9: getDatasource

 static function getDatasource()
 {
     return dibi::dataSource("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t[order]\n\t\t\tWHERE \n\t\t\t\tdeleted = 0\n\t\t\t");
 }
开发者ID:oaki,项目名称:demoshop,代码行数:4,代码来源:OrderModel.php

示例10: getProductParamDatasource

 static function getProductParamDatasource($id_product)
 {
     //POZOR upravi cenu podla zadavania dane SHOW_PRICE_WITH_TAX
     $tax_coef = self::getTaxCoefForProduct($id_product);
     $product_param_cols = Tools::getCollum('product_param');
     unset($product_param_cols['price']);
     //		dump($product_param_cols);exit;
     return dibi::dataSource("\n\t\t\tSELECT \n\t\t\t%sql", implode(',', $product_param_cols), "\n\t\t\t, ROUND((price*" . $tax_coef . "),2) AS price\n\t\t\tFROM \n\t\t\t[product_param] \n\t\t\tWHERE %if", $id_product == null, " id_product IS NULL %else id_product = %i", $id_product);
 }
开发者ID:oaki,项目名称:demoshop,代码行数:9,代码来源:ProductModel.php


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