Oneinfo(); $img['img'] = Yii::$app->params['httpImg']['host'].Yii::$app->params['httpImg']['fresh'].$img['img']; $city = (new PushFreshcity())->Homegetlist(); $ctype = new PushCharacteristic(); $cmodel = $ctype->Homegetlist(4); return $this->render('home',['img'=>$img,'city'=>$city,'cmodel'=>$cmodel]); } public function actionHomecityhouse() { $model = new PushFreshcityhouse(); $model->city_id = Yii::$app->request->post('id'); $rows = $model->Homegetlist(); if(!empty($rows)) { $tel = new \frontend\server\HouseServer(); foreach ($rows as &$val) { $val['tel'] = $tel->RandTel($val['cid']); $val['thumb'] = Yii::$app->params['httpImg']['hosts'].Yii::$app->params['httpImg']['houses'].$val['thumb']; } return Help::JsonCode(Help::SUCCESS,'成功',$rows); } } }