|
@@ -159,10 +159,6 @@ trait SQL
|
|
|
$this->fields = $this->fields == null ? $fields : $this->fields . ', ' . $fields;
|
|
|
return $this;
|
|
|
}
|
|
|
-
|
|
|
- if(preg_match('/(COUNT|SUM)\((.*)\)/', $this->fields)) {
|
|
|
- return $this;
|
|
|
- }
|
|
|
$arr = [];
|
|
|
foreach($fields as $field) {
|
|
|
// 处理 ['table1.field', 'table2.field']
|
|
@@ -942,6 +938,9 @@ trait SQL
|
|
|
* @return mixed|string
|
|
|
*/
|
|
|
final public function formatLimitForUpdate($limit) {
|
|
|
+ if($limit == null) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
preg_match("/LIMIT\s+(\d+),\s+(\d+)/", $limit, $matches);
|
|
|
if(count($matches) == 3) {
|
|
|
return "LIMIT ". intval($matches[2]);
|