Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
5ad6ba5c
Commit
5ad6ba5c
authored
Dec 23, 2014
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix from
e719ff58
moved to `yii\sphinx\Query`
parent
e719ff58
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
CHANGELOG.md
extensions/sphinx/CHANGELOG.md
+1
-1
Query.php
extensions/sphinx/Query.php
+28
-0
CHANGELOG.md
framework/CHANGELOG.md
+0
-1
Query.php
framework/db/Query.php
+2
-2
No files found.
extensions/sphinx/CHANGELOG.md
View file @
5ad6ba5c
...
...
@@ -4,7 +4,7 @@ Yii Framework 2 sphinx extension Change Log
2.
0.2 under development
-----------------------
-
no changes in this release.
-
Bug #6621: Creating sub query at
`yii\sphinx\Query::queryScalar()`
fixed (klimov-paul)
2.0.1 December 07, 2014
...
...
extensions/sphinx/Query.php
View file @
5ad6ba5c
...
...
@@ -367,6 +367,34 @@ class Query extends \yii\db\Query
}
/**
* @inheritdoc
*/
protected
function
queryScalar
(
$selectExpression
,
$db
)
{
$select
=
$this
->
select
;
$limit
=
$this
->
limit
;
$offset
=
$this
->
offset
;
$this
->
select
=
[
$selectExpression
];
$this
->
limit
=
null
;
$this
->
offset
=
null
;
$command
=
$this
->
createCommand
(
$db
);
$this
->
select
=
$select
;
$this
->
limit
=
$limit
;
$this
->
offset
=
$offset
;
if
(
empty
(
$this
->
groupBy
)
&&
empty
(
$this
->
union
)
&&
!
$this
->
distinct
)
{
return
$command
->
queryScalar
();
}
else
{
return
(
new
Query
)
->
select
([
$selectExpression
])
->
from
([
'c'
=>
$this
])
->
createCommand
(
$command
->
db
)
->
queryScalar
();
}
}
/**
* Creates a new Query object and copies its property values from an existing one.
* The properties being copies are the ones to be used by query builders.
* @param Query $from the source query object
...
...
framework/CHANGELOG.md
View file @
5ad6ba5c
...
...
@@ -7,7 +7,6 @@ Yii Framework 2 Change Log
-
Bug #6080: Oracle DB schema did not load column types correctly (wenbin1989)
-
Bug #6404: advanced application template
`Alert`
widget was generating duplicate IDs in case of multiple flashes (SDKiller)
-
Bug #6557: Link URLs generated by
`yii\widgets\Menu`
are not encoded (qiangxue)
-
Bug #6621:
`yii\db\Query::queryScalar()`
fixed to use
`static`
when creating subquery (klimov-paul)
-
Enh #6247: Logger and error handler are now using slightly less memory (stepanselyuk, samdark)
-
Enh #6434: Added
`yii\behaviors\SluggableBehavior::immutable`
to support keeping the generated slug unchanged (trntv)
-
Enh #6467:
`ActiveForm`
will scroll to the nearest visible element when the first error input is hidden (newartix)
...
...
framework/db/Query.php
View file @
5ad6ba5c
...
...
@@ -354,7 +354,7 @@ class Query extends Component implements QueryInterface
* @param Connection|null $db
* @return bool|string
*/
pr
ivate
function
queryScalar
(
$selectExpression
,
$db
)
pr
otected
function
queryScalar
(
$selectExpression
,
$db
)
{
$select
=
$this
->
select
;
$limit
=
$this
->
limit
;
...
...
@@ -372,7 +372,7 @@ class Query extends Component implements QueryInterface
if
(
empty
(
$this
->
groupBy
)
&&
empty
(
$this
->
union
)
&&
!
$this
->
distinct
)
{
return
$command
->
queryScalar
();
}
else
{
return
(
new
static
)
->
select
([
$selectExpression
])
return
(
new
Query
)
->
select
([
$selectExpression
])
->
from
([
'c'
=>
$this
])
->
createCommand
(
$command
->
db
)
->
queryScalar
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment