PublicuseController.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/5/22
  6. * Time: 上午10:30
  7. */
  8. namespace backend\controllers;
  9. use Yii;
  10. use backend\base\Help;
  11. use backend\base\CommonController;
  12. use common\models\House;
  13. use common\models\CategoryCity;
  14. use yii\web\Controller;
  15. class PublicuseController extends Controller
  16. {
  17. public function actionHousename()
  18. {
  19. return $this->render('housename');
  20. }
  21. /*
  22. * 获取所有楼盘数据
  23. * */
  24. public function actionAllhouseform()
  25. {
  26. $model = new House;
  27. $input = Yii::$app->request->post();
  28. if(!empty($input['name']))
  29. {
  30. $model->name = $input['name'];
  31. }
  32. $rows = $model->getList($input);
  33. if($rows != null)
  34. {
  35. return Help::JsonData(0,'成功',$model->getListTotal($input),$rows);
  36. }
  37. }
  38. /*
  39. * 区域
  40. * */
  41. public function actionCity()
  42. {
  43. return $this->render('city',['type'=>Yii::$app->request->get('type')]);
  44. }
  45. public function actionAllcity()
  46. {
  47. $model = new CategoryCity();
  48. $input = Yii::$app->request->post();
  49. if(!empty($input['name']))
  50. {
  51. $model->city_name = $input['name'];
  52. }
  53. $rows = $model->getList($input,['id','city_name']);
  54. if(!empty($rows))
  55. {
  56. return Help::JsonData(0,'成功',$model->Total(),$rows);
  57. }
  58. }
  59. /*
  60. * 楼盘特色主题
  61. * */
  62. public function actionCtype()
  63. {
  64. return $this->render('ctype');
  65. }
  66. public function actionAllctype()
  67. {
  68. $model = new \common\models\Characteristic();
  69. $rows = $model->getList([],['id','name']);
  70. if(!empty($rows))
  71. {
  72. return Help::JsonData(0,'成功',$model->Total(),$rows);
  73. }
  74. }
  75. /*
  76. * 资讯
  77. * */
  78. public function actionNews()
  79. {
  80. return $this->render('news',['type'=>Yii::$app->request->get('type')]);
  81. }
  82. /*
  83. * 资讯数据
  84. * */
  85. public function actionNewsform()
  86. {
  87. $model = new \common\models\News();
  88. $model->subject = Yii::$app->request->post('subject');
  89. $rows = $model->getList(Yii::$app->request->post());
  90. if(!empty($rows))
  91. {
  92. return Help::JsonData(0,'成功',$model->Total(),$rows);
  93. }
  94. }
  95. /*
  96. * 资讯 - 栏目
  97. * */
  98. public function actionNewscolumn()
  99. {
  100. return $this->render('newscolumn',['type'=>Yii::$app->request->get('type')]);
  101. }
  102. /*
  103. * 资讯 - 栏目数据
  104. * */
  105. public function actionNewscolumnform()
  106. {
  107. $model = new \common\models\CategoryNews();
  108. $input = Yii::$app->request->post();
  109. if(!empty($input['name']))
  110. {
  111. $model->news_name = $input['name'];
  112. }
  113. $rows = $model->getList($input,['id','news_name']);
  114. if(!empty($rows))
  115. {
  116. return Help::JsonData(0,'成功',$model->Total(),$rows);
  117. }
  118. }
  119. /*
  120. * 区域价格走势
  121. * */
  122. public function actionCityprice()
  123. {
  124. return $this->render('cityprice',['type'=>Yii::$app->request->get('type')]);
  125. }
  126. /*
  127. * 区域价格走势数据
  128. * */
  129. public function actionCitypriceform()
  130. {
  131. $model = new \common\models\Pricetrends();
  132. $rows = $model->getList(Yii::$app->request->post());
  133. if(!empty($rows))
  134. {
  135. return Help::JsonData(0,Yii::t('app','get_success'),$model->Total(),$rows);
  136. }
  137. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  138. }
  139. /**
  140. * 区域详情
  141. */
  142. public function actionCitydetails()
  143. {
  144. return $this->render('citydetails',['type'=>Yii::$app->request->get('type')]);
  145. }
  146. /**
  147. * 区域详情数据
  148. */
  149. public function actionCitydetailsform()
  150. {
  151. $model = new \common\models\CityDetails();
  152. $rows = $model->getList(Yii::$app->request->post());
  153. if(!empty($rows))
  154. {
  155. return Help::JsonData(0,Yii::t('app','get_success'),$model->Total(),$rows);
  156. }
  157. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  158. }
  159. }