123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- /**
- * Created by PhpStorm.
- * User: PFG2018
- * Date: 2018/12/5
- * Time: 14:37
- */
- namespace mobile\controllers;
- use common\Helps\Time;
- use common\models\PushHousesale;
- use mobile\base\CommonController;
- use Yii;
- use mobile\base\Help;
- class CityController extends CommonController
- {
- public $enableCsrfValidation = false;
- // 分离国内外
- public function actionFiltrate()
- {
- $city = new \common\models\CategoryCity();
- $city->abroad = 1;
- $rowsCity = $city->TypeAbroad(['id','city_name','a','pid']);
- if($rowsCity)
- {
- $rowsCity = getTree($rowsCity,0);
- }
- $city->abroad = 2;
- $city->del = 1;
- $city->state = 1;
- $city->pid = 0;
- $abroad = $city->getList([],['id','city_name','a','pid']);
- return $this->renderPartial('filtrate',['city'=>$rowsCity,'cityAbroad'=>$abroad,'name'=>Yii::$app->request->get('name')]);
- }
- public function actionSonlist()
- {
- $input = Yii::$app->request->post();
- $view = Yii::$app->view;
- if($input['pid'] == 0)
- {
- return Help::JsonCode(Help::SUCCESS,'成功', [
- ['id'=>90,'city_name'=>'胡志明市','url'=>'http://myuenan'.$view->params['main_city_url'].'?city=89'],
- ['id'=>91,'city_name'=>'河内市','url'=>'http://myuenan'.$view->params['main_city_url'].'?city=90'],
- ]);
- }
- if(!empty($input['pid']))
- {
- $model = new \common\models\CategoryCity();
- $findone = $model->FindById($input['pid']);
- if($findone)
- {
- $row = $model->SonCity($input['pid'],['id','city_name','a','pinyin']);
- if($row)
- {
- foreach ($row as &$val)
- {
- $val['url'] = 'http://m'.$findone['a'].'.'.$view->params['main_city_url'].'?city='.$val['id'];
- }
- return Help::JsonCode(Help::SUCCESS,'成功',$row);
- }
- }
- }
- return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
- }
-
- /*
- * 马来西亚-置业环境
- */
- public function actionMlxyindex()
- {
- return $this->render('mlxy/index');
- }
- /*
- * 马来西亚-发展状况
- */
- public function actionFzzk()
- {
- return $this->render('mlxy/fzzk');
- }
- /*
- * 马来西亚-第二家园
- */
- public function actionDejy()
- {
- return $this->render('mlxy/dejy');
- }
- /*
- * 马来西亚-房产优势
- */
- public function actionFcys()
- {
- return $this->render('mlxy/fcys');
- }
- /*
- * 马来西亚-购房须知
- */
- public function actionGfxz()
- {
- $Model = new PushHousesale();
- $Model->type = 6;
- $House = $Model->Homegetlist(5);
- if (!empty($House)) {
- foreach ($House as &$val) {
- $val['price_unit_1'] = explode('/',$val['price_unit'])[0];
- $val['price_unit_2'] = explode('/',$val['price_unit'])[1];
- }
- }
- $Time = Time::TermOfValidity_v2();
- return $this->render('mlxy/gfxz',['house'=>$House,'time'=>$Time]);
- }
- /*
- * 迪拜-首页迪拜概况
- */
- public function actionDubaiindex()
- {
- return $this->render('dubai/index');
- }
- /*
- * 迪拜-房产知识
- */
- public function actionFczs()
- {
- return $this->render('dubai/fczs');
- }
- /*
- * 迪拜-置业优势
- */
- public function actionZyys()
- {
- return $this->render('dubai/zyys');
- }
- /*
- * 迪拜-如何购房
- */
- public function actionRhgf()
- {
- return $this->render('dubai/rhgf');
- }
- /*
- * 迪拜-楼盘推荐
- */
- public function actionLptj()
- {
- $Model = new PushHousesale();
- $Model->type = 7;
- $House = $Model->Homegetlist(5);
- if (!empty($House)) {
- foreach ($House as &$val) {
- $val['price_unit_1'] = explode('/',$val['price_unit'])[0];
- $val['price_unit_2'] = explode('/',$val['price_unit'])[1];
- }
- }
- $Time = Time::TermOfValidity_v2();
- return $this->render('dubai/lptj',['house'=>$House,'time'=>$Time]);
- }
- /*
- * 区域专题首页
- */
- public function actionSpecial()
- {
- return $this->render('special');
- }
- }
|