|
@@ -8,6 +8,7 @@
|
8
|
8
|
|
9
|
9
|
namespace frontend\controllers;
|
10
|
10
|
|
|
11
|
+use backend\base\Help;
|
11
|
12
|
use common\models\House;
|
12
|
13
|
use common\models\SpecialTopic;
|
13
|
14
|
use frontend\base\CommonController;
|
|
@@ -149,6 +150,86 @@ class ZtController extends CommonController
|
149
|
150
|
$data = $server->GuoQingZhongQiu();
|
150
|
151
|
return $this->render('autumnzt',['data'=>$data]);
|
151
|
152
|
}
|
152
|
|
-
|
153
|
|
-
|
|
153
|
+
|
|
154
|
+ // 海南别墅专题
|
|
155
|
+ public function actionHnbszt()
|
|
156
|
+ {
|
|
157
|
+ $row = new \common\models\PushplaceType();
|
|
158
|
+ $city1 = $row->city1();
|
|
159
|
+ $city2 = $row->city2();
|
|
160
|
+ $hn_boutiquevilla = $row->boutiquevilla();
|
|
161
|
+ $hn_city = \common\models\CategoryCity::find()->where(['pid'=>68])->select('id,city_name')->asArray()->all();
|
|
162
|
+ $boutiquevillaList = [];
|
|
163
|
+ foreach ($hn_boutiquevilla as $value){
|
|
164
|
+ $boutiquevillaList[$value['id']] = (new \common\models\PushhouseType())->boutiquevillaList($value['id'],4);
|
|
165
|
+ }
|
|
166
|
+ $priceList = \common\models\HousePrice::find()->where(['del'=>1,'state'=>1])->orderBy(['sort'=>SORT_ASC])->asArray()->all();
|
|
167
|
+ //别墅动态
|
|
168
|
+ $villa_news = (new \common\models\PushnewsType())->getlist(4);
|
|
169
|
+ foreach ($villa_news as &$value){
|
|
170
|
+ $value['thumb'] = Yii::$app->params['httpImg']['host'] . Yii::$app->params['httpImg']['newsthumb'] . json_decode($value['thumb'],true)[0];
|
|
171
|
+ $value['time'] = date('Y.m.d',$value['create_at']);
|
|
172
|
+ }
|
|
173
|
+ //获取最新资讯
|
|
174
|
+ $new_news = \common\models\News::find()->select('id,subject,thumb,abstract,create_at')->where(['state'=>1,'del'=>1])->orderBy(['create_at'=>SORT_DESC,'id'=>SORT_DESC])->limit(4)->asArray()->all();
|
|
175
|
+ foreach ($new_news as &$value){
|
|
176
|
+ $value['thumb'] = Yii::$app->params['httpImg']['host'] . Yii::$app->params['httpImg']['newsthumb'] . json_decode($value['thumb'],true)[0];
|
|
177
|
+ $value['time'] = date('Y.m.d',$value['create_at']);
|
|
178
|
+ }
|
|
179
|
+ return $this->render('hnbszt', [
|
|
180
|
+ 'city1' => $city1,
|
|
181
|
+ 'city2' => $city2,
|
|
182
|
+ 'hn_city'=>$hn_city,
|
|
183
|
+ 'priceList'=>$priceList,
|
|
184
|
+ 'hn_boutiquevilla'=>$hn_boutiquevilla,
|
|
185
|
+ 'boutiquevillaList'=>$boutiquevillaList,
|
|
186
|
+ 'villa_news'=>$villa_news,
|
|
187
|
+ 'new_news'=>$new_news
|
|
188
|
+ ]);
|
|
189
|
+ }
|
|
190
|
+
|
|
191
|
+ //获取指定地区别墅TOP8
|
|
192
|
+ public function actionGetprovince()
|
|
193
|
+ {
|
|
194
|
+ $id = Yii::$app->request->post('city');
|
|
195
|
+ if(is_numeric($id)){
|
|
196
|
+ $data = \common\models\PushhouseType::find()
|
|
197
|
+ ->select(['pfg_house.id','pfg_house.name','pfg_house.sale_price','pfg_house.thumb','pfg_house_detail.price_unit','pfg_house_detail.preferential'])
|
|
198
|
+ ->where(['pfg_pushhouse_type.previd' => $id,'pfg_pushhouse_type.type'=>2])
|
|
199
|
+ ->innerJoin('pfg_house', 'pfg_house.id = pfg_pushhouse_type.hid')
|
|
200
|
+ ->innerJoin('pfg_house_detail','pfg_house_detail.hid = pfg_house.id')
|
|
201
|
+ ->limit(8)
|
|
202
|
+ ->orderBy(['pfg_pushhouse_type.sort'=>SORT_DESC])->asArray()->all();
|
|
203
|
+ foreach ($data as &$value){
|
|
204
|
+ $value['thumb'] = Yii::$app->params['httpImg']['hosts'] . Yii::$app->params['httpImg']['housesch'] . $value['thumb'] . '/same';
|
|
205
|
+ }
|
|
206
|
+ return Help::JsonData(Help::SUCCESS,'成功',0,$data);
|
|
207
|
+ }else{
|
|
208
|
+ return Help::JsonData(0,'成功',0,[]);
|
|
209
|
+ }
|
|
210
|
+ }
|
|
211
|
+
|
|
212
|
+ //获取湾区列表
|
|
213
|
+ public function actionGetgulfcitygl()
|
|
214
|
+ {
|
|
215
|
+ $id = Yii::$app->request->post('id');
|
|
216
|
+ if(is_numeric($id)){
|
|
217
|
+ $data = \common\models\PushhouseType::find()
|
|
218
|
+ ->select('pfg_pushhouse_type.*,pfg_house.name,pfg_house.city,pfg_house.sale_price,pfg_house.thumb,pfg_house_detail.price_unit')
|
|
219
|
+ ->where(['pfg_pushhouse_type.previd' => $id])
|
|
220
|
+ ->innerJoin('pfg_house', 'pfg_house.id = pfg_pushhouse_type.hid')
|
|
221
|
+ ->innerJoin('pfg_house_detail','pfg_house_detail.hid = pfg_house.id')
|
|
222
|
+ ->limit(6)
|
|
223
|
+ ->orderBy(['pfg_pushhouse_type.sort'=>SORT_DESC])->asArray()->all();
|
|
224
|
+ foreach ($data as &$value){
|
|
225
|
+ $value['thumb'] = Yii::$app->params['httpImg']['hosts'] . Yii::$app->params['httpImg']['housesch'] . $value['thumb'] . '/same';
|
|
226
|
+ $value['tel'] = $this->RandTel($value['city']);
|
|
227
|
+ }
|
|
228
|
+ return Help::JsonData(Help::SUCCESS,'成功',0,$data);
|
|
229
|
+ }else{
|
|
230
|
+ return Help::JsonData(0,'成功',0,[]);
|
|
231
|
+ }
|
|
232
|
+ }
|
|
233
|
+
|
|
234
|
+
|
154
|
235
|
}
|