本文整理匯總了PHP中yii\db\Query::Select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Query::Select方法的具體用法?PHP Query::Select怎麽用?PHP Query::Select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\db\Query
的用法示例。
在下文中一共展示了Query::Select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: searchPovod
public function searchPovod($params)
{
$query = new Query();
$query->Select("p.*,\n u.name username,\n i.image as image,\n i.autor as autor_image,\n t.autor as autor_text,\n t.text text,\n a.happyday isp,\n f.email,\n f.nati,\n f.prefics,\n i.id image_id,\n t.id text_id,\n u.public_email")->from('povod p')->leftjoin('otk_image i', 'i.povod_id = p.povod_id')->leftjoin('otk_text t', 't.povod_id = p.povod_id')->leftjoin('arhiv a', 'p.povod_id=a.povod_id and a.frend_id = p.frend_id and a.happyday=p.happyday')->leftJoin('frends f', 'f.id = p.frend_id')->leftJoin('profile u', 'u.user_id = p.user_id')->where($params)->groupBy(['p.frend_id', 'p.povod_id'])->orderBy(['p.happyday' => 'asc', 'p.povodname' => 'asc', 'p.frendname' => 'asc']);
$dataProvider = new ActiveDataProvider(['query' => $query]);
return $dataProvider;
}