PublicuseController.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. public function actionHousenamecn()
  22. {
  23. return $this->render('housenamecn');
  24. }
  25. /*
  26. * 获取所有国内楼盘数据
  27. * */
  28. public function actionAllhousecnform()
  29. {
  30. $model = new House();
  31. $input = Yii::$app->request->post();
  32. if (!empty($input['name'])) {
  33. $model->name = $input['name'];
  34. }
  35. $rows = $model->getList($input);
  36. if ($rows != null) {
  37. return Help::JsonData(0, '成功', $model->getListTotal($input), $rows);
  38. }
  39. }
  40. /*
  41. * 获取所有楼盘数据
  42. * */
  43. public function actionAllhouseform()
  44. {
  45. $model = new House;
  46. $input = Yii::$app->request->post();
  47. if(!empty($input['name']))
  48. {
  49. $model->name = $input['name'];
  50. }
  51. $rows = $model->getList($input);
  52. if($rows != null)
  53. {
  54. return Help::JsonData(0,'成功',$model->getListTotal($input),$rows);
  55. }
  56. }
  57. /*
  58. * 区域
  59. * */
  60. public function actionCity()
  61. {
  62. return $this->render('city',['type'=>Yii::$app->request->get('type')]);
  63. }
  64. public function actionAllcity()
  65. {
  66. $model = new CategoryCity();
  67. $input = Yii::$app->request->post();
  68. if(!empty($input['name']))
  69. {
  70. $model->city_name = $input['name'];
  71. }
  72. $rows = $model->getList($input,['id','city_name']);
  73. if(!empty($rows))
  74. {
  75. return Help::JsonData(0,'成功',$model->Total(),$rows);
  76. }
  77. }
  78. /*
  79. * 楼盘特色主题
  80. * */
  81. public function actionCtype()
  82. {
  83. return $this->render('ctype');
  84. }
  85. public function actionAllctype()
  86. {
  87. $model = new \common\models\Characteristic();
  88. $rows = $model->getList([],['id','name']);
  89. if(!empty($rows))
  90. {
  91. return Help::JsonData(0,'成功',$model->Total(),$rows);
  92. }
  93. }
  94. /*
  95. * 资讯
  96. * */
  97. public function actionNews()
  98. {
  99. return $this->render('news',['type'=>Yii::$app->request->get('type')]);
  100. }
  101. /*
  102. * 资讯数据
  103. * */
  104. public function actionNewsform()
  105. {
  106. $model = new \common\models\News();
  107. $model->subject = Yii::$app->request->post('subject');
  108. $rows = $model->getList(Yii::$app->request->post());
  109. if(!empty($rows))
  110. {
  111. return Help::JsonData(0,'成功',$model->Total(),$rows);
  112. }
  113. }
  114. /*
  115. * 资讯 - 栏目
  116. * */
  117. public function actionNewscolumn()
  118. {
  119. return $this->render('newscolumn',['type'=>Yii::$app->request->get('type')]);
  120. }
  121. /*
  122. * 资讯 - 栏目数据
  123. * */
  124. public function actionNewscolumnform()
  125. {
  126. $model = new \common\models\CategoryNews();
  127. $input = Yii::$app->request->post();
  128. if(!empty($input['name']))
  129. {
  130. $model->news_name = $input['name'];
  131. }
  132. $rows = $model->getList($input,['id','news_name']);
  133. if(!empty($rows))
  134. {
  135. return Help::JsonData(0,'成功',$model->Total(),$rows);
  136. }
  137. }
  138. /*
  139. * 区域价格走势
  140. * */
  141. public function actionCityprice()
  142. {
  143. return $this->render('cityprice',['type'=>Yii::$app->request->get('type')]);
  144. }
  145. /*
  146. * 区域价格走势数据
  147. * */
  148. public function actionCitypriceform()
  149. {
  150. $model = new \common\models\Pricetrends();
  151. $rows = $model->getList(Yii::$app->request->post());
  152. if(!empty($rows))
  153. {
  154. return Help::JsonData(0,Yii::t('app','get_success'),$model->Total(),$rows);
  155. }
  156. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  157. }
  158. /**
  159. * 区域详情
  160. */
  161. public function actionCitydetails()
  162. {
  163. return $this->render('citydetails',['type'=>Yii::$app->request->get('type')]);
  164. }
  165. /**
  166. * 区域详情数据
  167. */
  168. public function actionCitydetailsform()
  169. {
  170. $model = new \common\models\CityDetails();
  171. $rows = $model->getList(Yii::$app->request->post());
  172. if(!empty($rows))
  173. {
  174. return Help::JsonData(0,Yii::t('app','get_success'),$model->Total(),$rows);
  175. }
  176. return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
  177. }
  178. }