BrandController.php 2.2 KB

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