CityController.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: PFG2018
  5. * Date: 2018/12/5
  6. * Time: 14:37
  7. */
  8. namespace mobile\controllers;
  9. use common\Helps\Time;
  10. use common\models\PushHousesale;
  11. use mobile\base\CommonController;
  12. use Yii;
  13. use mobile\base\Help;
  14. class CityController extends CommonController
  15. {
  16. public $enableCsrfValidation = false;
  17. // 分离国内外
  18. public function actionFiltrate()
  19. {
  20. $city = new \common\models\CategoryCity();
  21. $city->abroad = 1;
  22. $rowsCity = $city->TypeAbroad(['id','city_name','a','pid']);
  23. if($rowsCity)
  24. {
  25. $rowsCity = getTree($rowsCity,0);
  26. }
  27. $city->abroad = 2;
  28. $city->del = 1;
  29. $city->state = 1;
  30. $city->pid = 0;
  31. $abroad = $city->getList([],['id','city_name','a','pid']);
  32. return $this->renderPartial('filtrate',['city'=>$rowsCity,'cityAbroad'=>$abroad,'name'=>Yii::$app->request->get('name')]);
  33. }
  34. public function actionSonlist()
  35. {
  36. $input = Yii::$app->request->post();
  37. $view = Yii::$app->view;
  38. if($input['pid'] == 0)
  39. {
  40. return Help::JsonCode(Help::SUCCESS,'成功', [
  41. ['id'=>90,'city_name'=>'胡志明市','url'=>'http://myuenan'.$view->params['main_city_url'].'?city=89'],
  42. ['id'=>91,'city_name'=>'河内市','url'=>'http://myuenan'.$view->params['main_city_url'].'?city=90'],
  43. ]);
  44. }
  45. if(!empty($input['pid']))
  46. {
  47. $model = new \common\models\CategoryCity();
  48. $findone = $model->FindById($input['pid']);
  49. if($findone)
  50. {
  51. $row = $model->SonCity($input['pid'],['id','city_name','a','pinyin']);
  52. if($row)
  53. {
  54. foreach ($row as &$val)
  55. {
  56. $val['url'] = 'http://m'.$findone['a'].'.'.$view->params['main_city_url'].'?city='.$val['id'];
  57. }
  58. return Help::JsonCode(Help::SUCCESS,'成功',$row);
  59. }
  60. }
  61. }
  62. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  63. }
  64. /*
  65. * 马来西亚-置业环境
  66. */
  67. public function actionMlxyindex()
  68. {
  69. return $this->render('mlxy/index');
  70. }
  71. /*
  72. * 马来西亚-发展状况
  73. */
  74. public function actionFzzk()
  75. {
  76. return $this->render('mlxy/fzzk');
  77. }
  78. /*
  79. * 马来西亚-第二家园
  80. */
  81. public function actionDejy()
  82. {
  83. return $this->render('mlxy/dejy');
  84. }
  85. /*
  86. * 马来西亚-房产优势
  87. */
  88. public function actionFcys()
  89. {
  90. return $this->render('mlxy/fcys');
  91. }
  92. /*
  93. * 马来西亚-购房须知
  94. */
  95. public function actionGfxz()
  96. {
  97. $Model = new PushHousesale();
  98. $Model->type = 6;
  99. $House = $Model->Homegetlist(5);
  100. if (!empty($House)) {
  101. foreach ($House as &$val) {
  102. $val['price_unit_1'] = explode('/',$val['price_unit'])[0];
  103. $val['price_unit_2'] = explode('/',$val['price_unit'])[1];
  104. }
  105. }
  106. $Time = Time::TermOfValidity_v2();
  107. return $this->render('mlxy/gfxz',['house'=>$House,'time'=>$Time]);
  108. }
  109. /*
  110. * 迪拜-首页迪拜概况
  111. */
  112. public function actionDubaiindex()
  113. {
  114. return $this->render('dubai/index');
  115. }
  116. /*
  117. * 迪拜-房产知识
  118. */
  119. public function actionFczs()
  120. {
  121. return $this->render('dubai/fczs');
  122. }
  123. /*
  124. * 迪拜-置业优势
  125. */
  126. public function actionZyys()
  127. {
  128. return $this->render('dubai/zyys');
  129. }
  130. /*
  131. * 迪拜-如何购房
  132. */
  133. public function actionRhgf()
  134. {
  135. return $this->render('dubai/rhgf');
  136. }
  137. /*
  138. * 迪拜-楼盘推荐
  139. */
  140. public function actionLptj()
  141. {
  142. $Model = new PushHousesale();
  143. $Model->type = 7;
  144. $House = $Model->Homegetlist(5);
  145. if (!empty($House)) {
  146. foreach ($House as &$val) {
  147. $val['price_unit_1'] = explode('/',$val['price_unit'])[0];
  148. $val['price_unit_2'] = explode('/',$val['price_unit'])[1];
  149. }
  150. }
  151. $Time = Time::TermOfValidity_v2();
  152. return $this->render('dubai/lptj',['house'=>$House,'time'=>$Time]);
  153. }
  154. /*
  155. * 区域专题首页
  156. */
  157. public function actionSpecial()
  158. {
  159. return $this->render('special');
  160. }
  161. }