PublicController.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?php
  2. namespace wechat\controllers;
  3. use common\models\CategoryCity;
  4. use wechat\base\CommonController;
  5. use Yii;
  6. use wechat\base\Help;
  7. class PublicController extends CommonController{
  8. public $enableCsrfValidation = false;
  9. /*
  10. * 报名弹窗
  11. * */
  12. public function actionSignup()
  13. {
  14. return $this->renderPartial('signup');
  15. }
  16. /*
  17. * 内页顶部导航
  18. * */
  19. public function actionNav()
  20. {
  21. return $this->renderPartial('nav');
  22. }
  23. /*
  24. * 内页顶部导航 侧边栏
  25. * */
  26. public function actionNavsidebar()
  27. {
  28. return $this->renderPartial('navsidebar');
  29. }
  30. /*
  31. * 报名弹窗
  32. * */
  33. public function actionCustomization()
  34. {
  35. $arr['price'] = ['不限',100,200,300,400,500,600,700,800,900,1000];
  36. $typeModel = new \common\models\CategoryHousetype();
  37. $typeModel->state = 1;
  38. $arr['type'] = $typeModel->getList([],['id','huxing_name']);
  39. $city = new \common\models\CategoryCity();
  40. $city->pid = 0;
  41. $arr['province'] = $city->getList([],['id','city_name']);
  42. // p($arr);1111
  43. // exit;
  44. return $this->renderPartial('customization',$arr);
  45. }
  46. // 楼盘 预售许可证
  47. public function actionLicence()
  48. {
  49. return $this->renderPartial('licence');
  50. }
  51. /*独立的报名窗口*/
  52. public function actionApplicationwindow()
  53. {
  54. $model = new \common\models\CategoryCity();
  55. $model->pid = 68;
  56. $city = $model->getList([],['id','city_name']);
  57. $province=$this->province();
  58. $type=$this->type();
  59. $price=$this->price();
  60. return $this->renderPartial('applicationwindow',['province'=>$province,'type'=>$type,'price'=>$price,'city'=>$city]);
  61. }
  62. public function actionTypes()
  63. {
  64. $rows = $this->type();
  65. if($rows)
  66. {
  67. return Help::JsonCode(Help::SUCCESS,Yii::t('app','get_success'),$rows);
  68. }
  69. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  70. }
  71. public function actionSaleprice()
  72. {
  73. $rows = $this->price();
  74. if($rows)
  75. {
  76. return Help::JsonCode(Help::SUCCESS,Yii::t('app','get_success'),$rows);
  77. }
  78. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  79. }
  80. /*
  81. * 公共报名-专业找房 2019-1-15
  82. */
  83. public function actionMajorlookhouse()
  84. {
  85. return $this->renderPartial('majorlookhouse');
  86. }
  87. /*户型*/
  88. public function type()
  89. {
  90. $TypeModel = new \common\models\CategoryHousetype();
  91. $TypeModel->state = 1;
  92. $type = $TypeModel->getList([],['id','huxing_name']);
  93. return $type;
  94. }
  95. /*价格*/
  96. public function price()
  97. {
  98. $priceModel = new \common\models\HousesPrice();
  99. $priceModel->state = 1;
  100. $price = $priceModel->getList([],['id','price']);
  101. return $price;
  102. }
  103. /*省份*/
  104. public function province()
  105. {
  106. $city = new \common\models\CategoryCity();
  107. $input = Yii::$app->request->post();
  108. if(!isset($input['pid']))
  109. {
  110. $city->pid = 0;
  111. }
  112. else
  113. {
  114. $city->pid = $input['city'];
  115. }
  116. $city->state = 1;
  117. $province = $city->getList([]);
  118. return $province;
  119. }
  120. /*传入父id获取城市*/
  121. public function actionGetcity()
  122. {
  123. $model = new \common\models\CategoryCity();
  124. $input = Yii::$app->request->post();
  125. $model->pid = $input['id'];
  126. $rows = $model->getList([],['id','city_name']);
  127. if(!empty($rows)) return Help::JsonCode(Help::SUCCESS,Yii::t('app','get_success'),$rows);
  128. }
  129. /*
  130. * 帮我找房
  131. * */
  132. public function actionFindroom()
  133. {
  134. //户型
  135. $TypeModel = new \common\models\CategoryHousetype();
  136. $Type = $TypeModel->getList([],['id','huxing_name']);
  137. //区域
  138. $City = (new CategoryCity())->GetUpCity();
  139. return $this->render('findroom',['type'=>$Type,'city'=>$City]);
  140. }
  141. /*
  142. * 404页面
  143. * */
  144. public function actionError()
  145. {
  146. return $this->renderPartial('error');
  147. }
  148. /*
  149. * 楼盘项目不存在显示的页面
  150. */
  151. public function actionShowhouse()
  152. {
  153. $m = new \common\models\House();
  154. $data = $m->HomegetList(5);
  155. foreach ($data as &$val)
  156. {
  157. $val['thumb'] = Yii::$app->params['httpImg']['hosts'].Yii::$app->params['httpImg']['houses'].$val['thumb'].'/'.'same';
  158. if(!empty($val['characteristic']))
  159. {
  160. $val['characteristic'] = \common\fm\HouseHandle::ChangeCharacteristic($val['characteristic']);
  161. }
  162. $val['tel'] = \common\fm\HouseHandle::ChangeCityTel($val['city']);
  163. }
  164. $start_time = date('Y/m').'/01-'.date('Y/m', strtotime('+ 2 month')).'/01'; //有效日期
  165. return $this->render('@app/views/house/xiajia.php',['model'=>$data,'start_time'=>$start_time]);
  166. }
  167. }