<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2019, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Query Builder Class
*
* This is the platform-independent base Query Builder implementation class.
*
* @package CodeIgniter
* @subpackage Drivers
* @category Database
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/
*/
abstract class CI_DB_query_builder extends CI_DB_driver {
/**
* Return DELETE SQL flag
*
* @var bool
*/
protected $return_delete_sql = FALSE;
/**
* Reset DELETE data flag
*
* @var bool
*/
protected $reset_delete_data = FALSE;
/**
* QB SELECT data
*
* @var array
*/
protected $qb_select = array();
/**
* QB DISTINCT flag
*
* @var bool
*/
protected $qb_distinct = FALSE;
/**
* QB FROM data
*
* @var array
*/
protected $qb_from = array();
/**
* QB JOIN data
*
* @var array
*/
protected $qb_join = array();
/**
* QB WHERE data
*
* @var array
*/
protected $qb_where = array();
/**
* QB GROUP BY data
*
* @var array
*/
protected $qb_groupby = array();
/**
* QB HAVING data
*
* @var array
*/
protected $qb_having = array();
/**
* QB keys
*
* @var array
*/
protected $qb_keys = array();
/**
* QB LIMIT data
*
* @var int
*/
protected $qb_limit = FALSE;
/**
* QB OFFSET data
*
* @var int
*/
protected $qb_offset = FALSE;
/**
* QB ORDER BY data
*
* @var array
*/
protected $qb_orderby = array();
/**
* QB data sets
*
* @var array
*/
protected $qb_set = array();
/**
* QB data set for update_batch()
*
* @var array
*/
protected $qb_set_ub = array();
/**
* QB aliased tables list
*
* @var array
*/
protected $qb_aliased_tables = array();
/**
* QB WHERE group started flag
*
* @var bool
*/
protected $qb_where_group_started = FALSE;
/**
* QB WHERE group count
*
* @var int
*/
protected $qb_where_group_count = 0;
// Query Builder Caching variables
/**
* QB Caching flag
*
* @var bool
*/
protected $qb_caching = FALSE;
/**
* QB Cache exists list
*
* @var array
*/
protected $qb_cache_exists = array();
/**
* QB Cache SELECT data
*
* @var array
*/
protected $qb_cache_select = array();
/**
* QB Cache FROM data
*
* @var array
*/
protected $qb_cache_from = array();
/**
* QB Cache JOIN data
*
* @var array
*/
protected $qb_cache_join = array();
/**
* QB Cache aliased tables list
*
* @var array
*/
protected $qb_cache_aliased_tables = array();
/**
* QB Cache WHERE data
*
* @var array
*/
protected $qb_cache_where = array();
/**
* QB Cache GROUP BY data
*
* @var array
*/
protected $qb_cache_groupby = array();
/**
* QB Cache HAVING data
*
* @var array
*/
protected $qb_cache_having = array();
/**
* QB Cache ORDER BY data
*
* @var array
*/
protected $qb_cache_orderby = array();
/**
* QB Cache data sets
*
* @var array
*/
protected $qb_cache_set = array();
/**
* QB No Escape data
*
* @var array
*/
protected $qb_no_escape = array();
/**
* QB Cache No Escape data
*
* @var array
*/
protected $qb_cache_no_escape = array();
// --------------------------------------------------------------------
/**
* Select
*
* Generates the SELECT portion of the query
*
* @param string
* @param mixed
* @return CI_DB_query_builder
*/
public function select($select = '*', $escape = NULL)
{
if (is_string($select))
{
$select = explode(',', $select);
}
// If the escape value was not set, we will base it on the global setting
is_bool($escape) OR $escape = $this->_protect_identifiers;
foreach ($select as $val)
{
$val = trim($val);
if ($val !== '')
{
$this->qb_select[] = $val;
$this->qb_no_escape[] = $escape;
if ($this->qb_caching === TRUE)
{
$this->qb_cache_select[] = $val;
$this->qb_cache_exists[] = 'select';
$this->qb_cache_no_escape[] = $escape;
}
}
}
return $this;
}
// --------------------------------------------------------------------
/**
* Select Max
*
* Generates a SELECT MAX(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_max($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'MAX');
}
// --------------------------------------------------------------------
/**
* Select Min
*
* Generates a SELECT MIN(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_min($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'MIN');
}
// --------------------------------------------------------------------
/**
* Select Average
*
* Generates a SELECT AVG(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_avg($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'AVG');
}
// --------------------------------------------------------------------
/**
* Select Sum
*
* Generates a SELECT SUM(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_sum($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'SUM');
}
// --------------------------------------------------------------------
/**
* SELECT [MAX|MIN|AVG|SUM]()
*
* @used-by select_max()
* @used-by select_min()
* @used-by select_avg()
* @used-by select_sum()
*
* @param string $select Field name
* @param string $alias
* @param string $type
* @return CI_DB_query_builder
*/
protected function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX')
{
if ( ! is_string($select) OR $select === '')
{
$this->display_error('db_invalid_query');
}
$type = strtoupper($type);
if ( ! in_array($type, array('MAX', 'MIN', 'AVG', 'SUM')))
{
show_error('Invalid function type: '.$type);
}
if ($alias === '')
{
$alias = $this->_create_alias_from_table(trim($select));
}
$sql = $type.
没有合适的资源?快使用搜索试试~ 我知道了~
基于codeigniter3的php淘宝客源码,内置淘宝sdk
共1700个文件
php:1582个
html:39个
md:10个
需积分: 21 2 下载量 138 浏览量
2023-03-08
16:45:49
上传
评论 1
收藏 5.02MB ZIP 举报
温馨提示
一个淘宝客源码,适合学习开发之用,或者建设一个简单的淘宝客网站app,
资源推荐
资源详情
资源评论
收起资源包目录
基于codeigniter3的php淘宝客源码,内置淘宝sdk (1700个子文件)
prod_ca_cert.crt 2KB
beta_ca_cert.crt 2KB
app.b612bb4c63eb6c77faa7e0aea790a091.css 101KB
app.bcb483a8ad96de5e3c96c74bc44f612b.css 101KB
app.baa03b73adcfe69102aef259ec08672b.css 101KB
phpunit.xml.dist 460B
.editorconfig 302B
.gitignore 511B
.gitkeep 0B
.htaccess 188B
.htaccess 123B
.htaccess 123B
.htaccess 117B
nginx.htaccess 0B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 1B
favicon.ico 5KB
elm.ea348af.jpeg 36KB
mt.43d83de.jpeg 25KB
Sunning.054f7fc.jpeg 25KB
el-ban.d2ef06b.jpg 625KB
pdd.fafebf6.jpg 171KB
jd.f429664.jpg 28KB
vendor.b78c586aa63a24555b37.js 684KB
app.8ae4369fa502b9937909.js 196KB
app.9b7be77875682452d5c3.js 186KB
app.2302b60ecbfbf0269a20.js 186KB
manifest.17490b280f1afd2d1291.js 857B
installed.json 8KB
composer.json 2KB
composer.json 827B
composer.json 594B
composer.json 562B
composer.json 353B
composer.json 325B
installed.json 69B
LICENSE 10KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
vendor.b78c586aa63a24555b37.js.map 2.64MB
app.8ae4369fa502b9937909.js.map 545KB
app.9b7be77875682452d5c3.js.map 536KB
app.2302b60ecbfbf0269a20.js.map 535KB
app.b612bb4c63eb6c77faa7e0aea790a091.css.map 167KB
app.bcb483a8ad96de5e3c96c74bc44f612b.css.map 167KB
app.baa03b73adcfe69102aef259ec08672b.css.map 167KB
manifest.17490b280f1afd2d1291.js.map 5KB
CHANGELOG.md 21KB
02-handlers-formatters-processors.md 10KB
01-usage.md 8KB
contributing.md 6KB
README.md 4KB
README.md 3KB
04-extending.md 2KB
README.md 1KB
sockets.md 1023B
03-utilities.md 928B
DB_query_builder.php 62KB
Email.php 55KB
DB_driver.php 45KB
共 1700 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
资源评论
qikexun
- 粉丝: 63
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功