render('home'); } public function actionDetails() { return $this->render('details'); } public function actionAa() { $p = \common\model\CategoryCity::find()->select(['id','city_name'])->andWhere(['del'=>1])->andWhere(['pid'=>0])->asArray()->all(); $p = array_column($p,'id','city_name'); $son = \common\model\CategoryCity::find()->select(['id','city_name'])->andWhere(['del'=>1])->andWhere(['pid'=>$p])->asArray()->all(); $sonArr = []; foreach ($son as $key => $value) { $sonArr[$value['pid']][] = $value; } p($sonArr); } }