12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace wechat\controllers;
- use wechat\base\CommonController;
- class GroupController extends CommonController{
- public function actionHome()
- {
- return $this->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);
- }
- }
|