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


PHP SJB_DB::getAffectedRows方法代码示例

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


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

示例1: getObjectInfo

 function getObjectInfo($sorting_fields, $inner_join = false, $relevance = false)
 {
     $SearchSqlTranslator = new SJB_GuestAlertSearchSQLTranslator($this->table_prefix);
     $sql_string = $SearchSqlTranslator->buildSqlQuery($this->criteria, $this->valid_criterion_number, $sorting_fields, $this->inner_join);
     if ($this->sorting_field !== false && $this->sorting_order !== false) {
         $sql_string .= ' ORDER BY ' . $this->sorting_field . ' ' . $this->sorting_order . ' ';
     }
     SJB_DB::queryExec($sql_string);
     $affectedRows = SJB_DB::getAffectedRows();
     if ($this->limit !== false) {
         if (isset($this->limit['limit'])) {
             $sql_string .= 'limit ' . $this->limit['limit'] . ', ' . $this->limit['num_rows'];
         } else {
             $sql_string .= 'limit ' . $this->limit . ', 100';
         }
     }
     $sql_results = SJB_DB::query($sql_string);
     $result = array();
     foreach ($sql_results as $sql_result) {
         if ($this->valid_criterion_number == 0 || $sql_result['countRows'] == $this->valid_criterion_number) {
             $result[]['object_sid'] = $sql_result['object_sid'];
         }
     }
     $this->affectedRows = $affectedRows - (SJB_DB::getAffectedRows() - count($result));
     return $result;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:26,代码来源:GuestAlertInfoSearcher.php

示例2: getObjectInfo

 function getObjectInfo($sorting_fields, $inner_join = false, $relevance = false)
 {
     $searchSqlTranslator = new SJB_SearchSqlTranslator($this->table_prefix);
     $sql_string = $searchSqlTranslator->buildSqlQuery($this->criteria, $this->valid_criterion_number, array($this->sorting_field => $this->sorting_order), $this->inner_join);
     SJB_DB::query($sql_string);
     $this->affectedRows = SJB_DB::getAffectedRows();
     if ($this->limit !== false) {
         if (isset($this->limit['limit'])) {
             $sql_string .= " limit " . $this->limit['limit'] . ", " . $this->limit['num_rows'];
         } else {
             $sql_string .= " limit " . $this->limit . ", 100";
         }
     }
     return SJB_DB::query($sql_string);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:15,代码来源:Transaction.php

示例3: getObjectInfo

 function getObjectInfo($sorting_fields, $inner_join = false, $relevance = false)
 {
     $searchSqlTranslator = new SJB_InvoiceSearchSQLTranslator($this->table_prefix);
     $sqlString = $searchSqlTranslator->buildSqlQuery($this->criteria, $this->valid_criterion_number, $sorting_fields, $this->inner_join);
     $where = '';
     if ($this->sorting_field !== false && $this->sorting_order !== false) {
         $sqlString .= $where . "ORDER BY " . $this->sorting_field . " " . $this->sorting_order . " ";
     }
     SJB_DB::queryExec($sqlString);
     $this->affectedRows = SJB_DB::getAffectedRows();
     if ($this->limit !== false) {
         if (isset($this->limit['limit'])) {
             $sqlString .= "limit " . $this->limit['limit'] . ", " . $this->limit['num_rows'];
         } else {
             $sqlString .= "limit " . $this->limit . ", 100";
         }
     }
     return SJB_DB::query($sqlString);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:19,代码来源:InvoiceInfoSearcher.php

示例4: getObjectInfo

 function getObjectInfo($sorting_fields, $inner_join = false, $relevance = false)
 {
     if (isset($this->inner_join['contracts'])) {
         $this->searchSqlTranslator->setDistinct(true);
     }
     $sql_string = $this->searchSqlTranslator->buildSqlQuery($this->criteria, $this->valid_criterion_number, $sorting_fields, $this->inner_join);
     $where = '';
     $groupBy = '';
     if ($this->sorting_field !== false && $this->sorting_order !== false) {
         $sorting = '';
         if ($this->inner_join) {
             foreach ($this->inner_join as $key => $val) {
                 if (isset($val['sort_field'])) {
                     if (isset($val['noPresix'])) {
                         $this->sorting_field = $val['sort_field'];
                     } else {
                         $this->sorting_field = "`" . $key . "`." . $val['sort_field'];
                     }
                 }
                 if (isset($val['where'])) {
                     $where .= " {$val['where']} ";
                 }
                 if (isset($val['groupBy'])) {
                     $groupBy .= " GROUP BY {$val['groupBy']} ";
                 }
                 if (isset($val['join']) && $val['join'] != 'INNER JOIN') {
                     $this->searchSqlTranslator->setDistinct(true);
                 }
             }
         }
         if (is_array($this->sorting_field)) {
             $i = 0;
             foreach ($this->sorting_field as $sorting_field) {
                 $sorting .= " {$sorting_field} {$this->sorting_order}";
                 if ($i == 0) {
                     $sorting .= ', ';
                 }
                 $i++;
             }
         } else {
             $sorting = $this->sorting_field . " " . $this->sorting_order;
         }
         $sql_string .= $where . " {$groupBy} ORDER BY  {$sorting} ";
     }
     $affectedRows = 0;
     if ($this->limit !== false) {
         SJB_DB::queryExec($sql_string);
         $affectedRows = SJB_DB::getAffectedRows();
         if (isset($this->limit['limit'])) {
             $sql_string .= "limit " . $this->limit['limit'] . ", " . $this->limit['num_rows'];
         } else {
             $sql_string .= "limit " . $this->limit . ", 100";
         }
     }
     $sql_results = SJB_DB::query($sql_string);
     if ($this->limit === false) {
         $affectedRows = SJB_DB::getAffectedRows();
     }
     $result = array();
     foreach ($sql_results as $sql_result) {
         if ($this->valid_criterion_number == 0 || $sql_result['countRows'] == $this->valid_criterion_number) {
             $result[]['object_sid'] = $sql_result['object_sid'];
         }
     }
     $this->affectedRows = $affectedRows - (SJB_DB::getAffectedRows() - count($result));
     // TODO написала это потому что в browseCompany неправильно считается общее количество компаний. Например по факту находится одна компания, но пишется, что найдено 16.
     if ($this->limitByPHP !== false) {
         $newArr = $result;
         $result = array();
         for ($i = $this->limitByPHP['limit']; $i < $this->limitByPHP['limit'] + $this->limitByPHP['num_rows']; $i++) {
             if (!isset($newArr[$i])) {
                 break;
             }
             $result[$i] = $newArr[$i];
         }
     }
     return $result;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:78,代码来源:UserInfoSearcher.php

示例5: getObjectInfo

 function getObjectInfo($sorting_fields, $inner_join = false, $relevance = false)
 {
     $SearchSqlTranslator = new SJB_PaymentLogSearchSQLTranslator($this->table_prefix);
     $sql_string = $SearchSqlTranslator->buildSqlQuery($this->criteria, $this->valid_criterion_number, array($this->sorting_field => $this->sorting_order));
     SJB_DB::query($sql_string);
     $this->affectedRows = SJB_DB::getAffectedRows();
     $paging_offset = ($this->current_page - 1) * $this->items_per_page;
     $sql_string .= " LIMIT {$paging_offset}, {$this->items_per_page}";
     return SJB_DB::query($sql_string);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:10,代码来源:PaymentLog.php


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