render('newyear'); } // 新年专题 public function actionNewyearzt() { return $this->render('newyearzt'); } // 碧桂园鼎龙湾专题 public function actionBgydlw() { return $this->render('bgydlw'); } /*金九银十专题*/ public function actionJjys() { return $this->render('jjys'); } /*国庆专题*/ public function actionNationalzt() { return $this->render('nationalzt'); } /*融创高隆湾 3天2晚游*/ public function actionRcglw() { return $this->render('rcglw'); } // 春节专题 public function actionChunjiezt() { $ztmodel = new \common\models\SpecialTopic(); $row = $ztmodel::findOne(7); $model = new \common\models\House(); $cmodel = new \common\models\CategoryCity(); $city = ''; $house = ''; $imgUrl = Yii::$app->params['httpImg']['host'] . Yii::$app->params['httpImg']['push_lb']; if (!empty(json_decode($row->hids, true))) { $hid = json_decode($row->hids, true); $query = $model::find(); $query->andWhere(['pfg_house.id' => $hid]); $query->joinWith(['housedetail']); $query->with(['cityName']); $query->orderBy(['pfg_house.sort' => SORT_DESC]); $house = $query->asArray()->all(); $pcity = array_column($house, 'province'); $cquey = $cmodel::find(); $cquey->select(['id', 'city_name']); $cquey->andWhere(['id' => $pcity]); $cquey->orderBy(['sort' => SORT_DESC]); $city = array_column($cquey->asArray()->all(), 'city_name', 'id'); } empty($row->pc_img) ? '' : $row->pc_img = $imgUrl . $row->pc_img; return $this->render('chunjiezt', ['city' => $city, 'house' => $house, 'model' => $row]); } /** * 线上售楼处专题 * @return string */ public function actionSellhousezt() { $row = SpecialTopic::findOne(8); if (!empty($row)) { $hid = json_decode($row['hids'], true); $house = House::find()->select(['pfg_house.id', 'pfg_house.name', 'pfg_house_detail.address', 'pfg_house.thumb', 'pfg_house_detail.preferential_zt', 'pfg_house.sale_price', 'pfg_house_detail.price_unit', 'pfg_category_city.pid']) ->leftJoin('pfg_house_detail', 'pfg_house.id = pfg_house_detail.hid') ->leftJoin('pfg_category_city', 'pfg_house.city = pfg_category_city.id') ->andWhere(['pfg_house.id' => $hid]) ->orderBy(['pfg_house.sort' => SORT_DESC])->asArray()->all(); } return $this->render('sellhousezt', ['house' => $house, 'row' => $row]); } //楼盘随机电话 public function RandTel($city) { $tel = new \common\models\CategoryTelCity(); $tel->cid = $city; $telModel = $tel->CityTelOne(); if ($telModel != null) { $telArr = explode(',', $telModel['tel']); $randNum = array_rand($telArr, 1); if (!empty($telArr[$randNum])) { return $telArr[$randNum]; } } return Yii::$app->params['default_dialtel']; } // 写字楼专题 public function actionOffice() { $cityList = \common\models\PushplaceType::find()->where(['type' => 4, 'state' => 1])->limit(2)->orderBy(['sort' => SORT_DESC])->select('id,title')->asArray()->all(); foreach ($cityList as &$val) { $val['house_list'] = \common\models\PushhouseType::find() ->select('pfg_pushhouse_type.*,pfg_house.name,pfg_house.city,pfg_house.sale_price,pfg_house.thumb,pfg_house_detail.price_unit,pfg_house_detail.address,pfg_house_detail.preferential,pfg_house_detail.preferential_price,pfg_house_detail.preferential_zt') ->where(['pfg_pushhouse_type.previd' => $val['id'], 'pfg_pushhouse_type.type' => 4]) ->innerJoin('pfg_house', 'pfg_house.id = pfg_pushhouse_type.hid') ->innerJoin('pfg_house_detail', 'pfg_house_detail.hid = pfg_house.id') ->orderBy(['pfg_pushhouse_type.sort' => SORT_DESC])->asArray()->all(); foreach ($val['house_list'] as &$value) { $value['thumb'] = Yii::$app->params['httpImg']['hosts'] . Yii::$app->params['httpImg']['houses'] . $value['thumb'] . '/same'; $value['tel'] = $this->RandTel($value['city']); } } if (!empty($cityList)) { $cityList[0]['house_list'] = array_chunk($cityList[0]['house_list'], 3); } return $this->render('office', ['cityList' => $cityList]); } // 国庆中秋专题 public function actionAutumnzt() { $server = new ZtServer(); $data = $server->GuoQingZhongQiu(); return $this->render('autumnzt',['data'=>$data]); } }