Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
catfan committed Nov 24, 2017
2 parents d638b09 + 23cf97b commit 0498651
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Medoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*!
* Medoo database framework
* https://medoo.in
* Version 1.5
* Version 1.5.1
*
* Copyright 2017, Angel Lai
* Released under the MIT license
Expand Down Expand Up @@ -808,11 +808,11 @@ protected function whereClause($where, &$map)
{
$stack[] = 'FIELD(' . $this->columnQuote($column) . ', ' . $this->arrayQuote($value) . ')';
}
else if ($value === 'ASC' || $value === 'DESC')
elseif ($value === 'ASC' || $value === 'DESC')
{
$stack[] = $this->columnQuote($column) . ' ' . $value;
}
else if (is_int($column))
elseif (is_int($column))
{
$stack[] = $this->columnQuote($value);
}
Expand Down Expand Up @@ -1032,7 +1032,7 @@ protected function columnMap($columns, &$stack)
{
preg_match('/([a-zA-Z0-9_]+\.)?(?<column>[a-zA-Z0-9_]+)(?:\s*\((?<alias>[a-zA-Z0-9_]+)\))?(?:\s*\[(?<type>(?:String|Bool|Int|Number|Object|JSON))\])?/i', $value, $key_match);

$column_key = !empty($key_match[ 'alias' ]) ?
$column_key = isset($key_match[ 'alias' ]) ?
$key_match[ 'alias' ] :
$key_match[ 'column' ];

Expand Down

0 comments on commit 0498651

Please sign in to comment.