db\Query addSelect()

addSelect() public method

Add more columns to the SELECT part of the query.

Note, that if select() has not been specified before, you should include * explicitly if you want to select all remaining columns too:

$query->addSelect(["*", "CONCAT(first_name, ' ', last_name) AS full_name"])->one();

See also select().

public $this addSelect ( $columns )
$columns string|array|yii\db\Expression

The columns to add to the select. See select() for more details about the format of this parameter.

return $this

The query object itself

doc_Yii
2016-10-30 16:58:55
Comments
Leave a Comment

Please login to continue.