feat: 本次提交更新内容如下

php有问题,覆盖下
This commit is contained in:
笔记本里的永平
2025-07-07 14:52:56 +08:00
parent c29fbd1bbb
commit c9a3aaab58
338 changed files with 70315 additions and 12737 deletions

View File

@@ -12,6 +12,7 @@
namespace think\db\builder;
use think\db\Builder;
use think\db\Query;
/**
* Sqlite数据库驱动
@@ -22,12 +23,14 @@ class Sqlite extends Builder
/**
* limit
* @access public
* @param string $limit
* @param Query $query 查询对象
* @param mixed $limit
* @return string
*/
public function parseLimit($limit)
public function parseLimit(Query $query, $limit)
{
$limitStr = '';
if (!empty($limit)) {
$limit = explode(',', $limit);
if (count($limit) > 1) {
@@ -36,27 +39,30 @@ class Sqlite extends Builder
$limitStr .= ' LIMIT ' . $limit[0] . ' ';
}
}
return $limitStr;
}
/**
* 随机排序
* @access protected
* @param Query $query 查询对象
* @return string
*/
protected function parseRand()
protected function parseRand(Query $query)
{
return 'RANDOM()';
}
/**
* 字段和表名处理
* @access protected
* @param mixed $key
* @param array $options
* @access public
* @param Query $query 查询对象
* @param mixed $key 字段名
* @param bool $strict 严格检测
* @return string
*/
protected function parseKey($key, $options = [], $strict = false)
public function parseKey(Query $query, $key, $strict = false)
{
if (is_numeric($key)) {
return $key;
@@ -65,18 +71,26 @@ class Sqlite extends Builder
}
$key = trim($key);
if (strpos($key, '.')) {
list($table, $key) = explode('.', $key, 2);
$alias = $query->getOptions('alias');
if ('__TABLE__' == $table) {
$table = $this->query->getTable();
$table = $query->getOptions('table');
$table = is_array($table) ? array_shift($table) : $table;
}
if (isset($options['alias'][$table])) {
$table = $options['alias'][$table];
if (isset($alias[$table])) {
$table = $alias[$table];
}
}
if (isset($table)) {
$key = $table . '.' . $key;
}
return $key;
}
}