BrandController.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace wechat\controllers;
  3. use common\models\Developers;
  4. use common\models\PushmColumn;
  5. use common\models\PushmHouse;
  6. use wechat\base\CommonController;
  7. use wechat\server\IndexServer;
  8. use Yii;
  9. class BrandController extends CommonController{
  10. public function actionHome()
  11. {
  12. $input = Yii::$app->request->get();
  13. if(is_numeric($input['bid']))
  14. {
  15. $bid = PushmColumn::find()->select(['id','did'])->andWhere(['id'=>$input['bid']])->asArray()->one();
  16. $model = new PushmHouse();
  17. $model->type = 6;
  18. $model->developers_id = $bid['did'];
  19. $house = $model->GetHouse();
  20. if ($house){
  21. foreach ($house as &$val){
  22. $val['thumb'] = Yii::$app->params['httpImg']['hosts'].Yii::$app->params['httpImg']['houses'].$val['thumb'].'/'.'same';
  23. if(!empty($val['characteristic']))
  24. {
  25. $val['characteristic'] = \common\fm\HouseHandle::ChangeCharacteristic($val['characteristic']);
  26. // (new IndexServer())->Subject(json_decode($val['characteristic']),3);
  27. }
  28. // $val['tel'] = (new IndexServer())->RandTel($val['city']);
  29. $val['tel'] = \common\fm\HouseHandle::ChangeCityTel($val['city']);
  30. $val['rand'] = rand(300,800);
  31. }
  32. }
  33. $column = PushmColumn::find()->andWhere(['id'=>$input['bid']])->asArray()->one();
  34. if ($column){
  35. $column['img_a'] = Yii::$app->params['httpImg']['host'].Yii::$app->params['httpImg']['push_lb'].$column['img_a'];
  36. }
  37. $developers = Developers::find()->andWhere(['id'=>$column['did']])->andWhere(['is_del'=>1])->asArray()->one();
  38. return $this->render('home',['house'=>$house,'column'=>$column,'developers'=>$developers]);
  39. }
  40. return $this->goBack();
  41. }
  42. }