goHome(); // } public function actionHome() { $pushModel = new NewsServer(); $one = $pushModel->Pushinfo(1); $two = $pushModel->Pushinfo(2); $three = $pushModel->Pushinfo(3); //热点直达 // $ctype = new \common\models\PushCharacteristic(); $cmodel = $pushModel->hotArrive(); $clickNews = $pushModel->clickList(10); $column = $pushModel->ColumnInfo(); $model = new \common\models\News(); if (is_numeric(Yii::$app->request->get('cid'))) { $model->category = Yii::$app->request->get('cid'); } $newsList = $model->HomeList(Yii::$app->request->get()); $dynamic = (new News())->GetDynamic(6); //优惠动态 $comment = (new HouseComment())->GetComment(5); //热门点评 if (!empty($comment)) { foreach ($comment as &$val) { $val['mobile'] = preg_replace("/(\d{3})\d\d(\d{2})/", "\$1****\$3", $val['mobile']); $val['create_at'] = date('Y-m-d H:i:s', $val['create_at']); } } //实景看房 $vrhouse = (new Video())->RandList(3, 2); //底部热销推荐 $housemodel = new House(); $housemodel->is_push = 2; $house = $housemodel->ispush(8); //资讯标题 $title = ''; if (!empty(Yii::$app->request->get('cid'))) { $title = CategoryNews::findOne(Yii::$app->request->get('cid')); } return $this->render('home', ['title' => $title, 'house' => $house, 'vrhouse' => $vrhouse, 'comment' => $comment, 'dynamic' => $dynamic, 'one' => $one, 'two' => $two, 'three' => $three, 'ctype' => $cmodel, 'click' => $clickNews, 'column' => $column, 'all' => $newsList, 'page' => $newsList['page']]); } public function actionDetails() { $input = Yii::$app->request->get(); $model = new NewsServer(); $row = $model->NewsDetails($input); if (empty($row)) { $m = new \common\models\House(); $m->is_push = 2; $data = $m->HomegetList(4); return $this->render('@app/views/news/newsxiajia', ['model' => $data]); } $housetel = new HouseServer(); $tel = $housetel->RandTel($row['city']); $category = $model->Relevant($row['category']); //点击量排序 $clickNews = $model->clickList(5); //热点直达 $cityHouse = $model->NewsCityHouse($row['city']); //热销楼盘 $model = new \common\models\PushHousesale(); $model->type = 1; $hotHouse = $model->Homegetlist(4); //获取最新资讯 $todaynews = (new NewsServer())->GetNews(5); //老业主推荐页数 $datacount = $m = new \common\models\House(); $m->is_push = 2; $count = ceil($m->ispushcount()) / 5; //查询资讯相关楼盘 // $HouseNewsMdoel = new HouseNews(); // $HouseNews = $HouseNewsMdoel->GetHouse($input); // $NewsHouse = ''; $NewsHouse = []; if (!empty($row['hid'])) { $NewsHouse = (new House())->GetOneHouse($row['hid']); if (!empty($NewsHouse)) { $NewsHouse['tel'] = HouseHandle::ChangeCityTel($NewsHouse['city']); $NewsHouse['chara'] = HouseHandle::ChangeCharacteristic($NewsHouse['characteristic']); } } return $this->render('details', [ 'model' => $row, 'category' => $category, 'hotnews' => $clickNews, 'cityhouse' => $cityHouse, 'hothouse' => $hotHouse, 'tel' => $tel, 'todaynews' => $todaynews, 'count' => $count, 'newshouse' => $NewsHouse, ]); } //资讯详情页-老业主推荐 public function actionNewshouse() { $get = Yii::$app->request->get(); $modle = new \common\models\HouseNews(); $data = $modle::find()->andWhere(['nid' => $get['nid'], 'del' => 1, 'is_view' => 1])->one(); $housemodel = new House(); if (!empty($data)) { $housemodel->city = $data->houseCity; } $housemodel->is_push = 2; $house = $housemodel->ispush(5, $get); if (!empty($house)) { foreach ($house as &$val) { $val['thumb'] = Yii::$app->params['httpImg']['hosts'] . Yii::$app->params['httpImg']['houses'] . $val['thumb'] . '/same'; } return Help::JsonCode(Help::SUCCESS, '成功', $house); } return Help::JsonCode(Help::ERROR, '暂无数据'); } }