12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- * Created by PhpStorm.
- * User: xiaofeng
- * Date: 2018/4/19
- * Time: 下午2:52
- */
- namespace mobile\controllers;
- use mobile\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);
- }
- }
|