www.gusucode.com > Catfish(鲶鱼) CMS系统 PHP版 v4.8.21源码程序 > Catfishcms_v4.8.21/catfish/library/think/db/builder/Sqlite.php
<?php // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- // | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: liu21st <liu21st@gmail.com> // +---------------------------------------------------------------------- namespace think\db\builder; use think\db\Builder; /** * Sqlite数据库驱动 */ class Sqlite extends Builder { /** * limit * @access public * @return string */ public function parseLimit($limit) { $limitStr = ''; if (!empty($limit)) { $limit = explode(',', $limit); if (count($limit) > 1) { $limitStr .= ' LIMIT ' . $limit[1] . ' OFFSET ' . $limit[0] . ' '; } else { $limitStr .= ' LIMIT ' . $limit[0] . ' '; } } return $limitStr; } /** * 随机排序 * @access protected * @return string */ protected function parseRand() { return 'RANDOM()'; } }