12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace wechat\controllers;
- use common\models\Developers;
- use common\models\PushmColumn;
- use common\models\PushmHouse;
- use wechat\base\CommonController;
- use wechat\server\IndexServer;
- use Yii;
- class BrandController extends CommonController{
- public function actionHome()
- {
- $input = Yii::$app->request->get();
- if(is_numeric($input['bid']))
- {
- $bid = PushmColumn::find()->select(['id','did'])->andWhere(['id'=>$input['bid']])->asArray()->one();
- $model = new PushmHouse();
- $model->type = 6;
- $model->developers_id = $bid['did'];
- $house = $model->GetHouse();
- if ($house){
- foreach ($house as &$val){
- $val['thumb'] = Yii::$app->params['httpImg']['hosts'].Yii::$app->params['httpImg']['houses'].$val['thumb'].'/'.'same';
- if(!empty($val['characteristic']))
- {
- $val['characteristic'] = \common\fm\HouseHandle::ChangeCharacteristic($val['characteristic']);
- // (new IndexServer())->Subject(json_decode($val['characteristic']),3);
- }
- // $val['tel'] = (new IndexServer())->RandTel($val['city']);
- $val['tel'] = \common\fm\HouseHandle::ChangeCityTel($val['city']);
- $val['rand'] = rand(300,800);
- }
- }
-
- $column = PushmColumn::find()->andWhere(['id'=>$input['bid']])->asArray()->one();
- if ($column){
- $column['img_a'] = Yii::$app->params['httpImg']['host'].Yii::$app->params['httpImg']['push_lb'].$column['img_a'];
- }
- $developers = Developers::find()->andWhere(['id'=>$column['did']])->andWhere(['is_del'=>1])->asArray()->one();
- return $this->render('home',['house'=>$house,'column'=>$column,'developers'=>$developers]);
- }
- return $this->goBack();
- }
- }
|