123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <?php
- /**
- * Created by PhpStorm.
- * User: xiaofeng
- * Date: 2018/5/22
- * Time: 上午10:30
- */
- namespace backend\controllers;
- use Yii;
- use backend\base\Help;
- use backend\base\CommonController;
- use common\models\House;
- use common\models\CategoryCity;
- use yii\web\Controller;
- class PublicuseController extends Controller
- {
- public function actionHousename()
- {
- return $this->render('housename');
- }
-
- public function actionHousenamecn()
- {
- return $this->render('housenamecn');
- }
-
- /*
- * 获取所有国内楼盘数据
- * */
- public function actionAllhousecnform()
- {
- $model = new House();
- $input = Yii::$app->request->post();
- if (!empty($input['name'])) {
- $model->name = $input['name'];
- }
- $rows = $model->getList($input);
- if ($rows != null) {
- return Help::JsonData(0, '成功', $model->getListTotal($input), $rows);
- }
- }
- /*
- * 获取所有楼盘数据
- * */
- public function actionAllhouseform()
- {
- $model = new House;
- $input = Yii::$app->request->post();
- if(!empty($input['name']))
- {
- $model->name = $input['name'];
- }
- $rows = $model->getList($input);
- if($rows != null)
- {
- return Help::JsonData(0,'成功',$model->getListTotal($input),$rows);
- }
- }
- /*
- * 区域
- * */
- public function actionCity()
- {
- return $this->render('city',['type'=>Yii::$app->request->get('type')]);
- }
- public function actionAllcity()
- {
- $model = new CategoryCity();
- $input = Yii::$app->request->post();
- if(!empty($input['name']))
- {
- $model->city_name = $input['name'];
- }
- $rows = $model->getList($input,['id','city_name']);
- if(!empty($rows))
- {
- return Help::JsonData(0,'成功',$model->Total(),$rows);
- }
- }
- /*
- * 楼盘特色主题
- * */
- public function actionCtype()
- {
- return $this->render('ctype');
- }
- public function actionAllctype()
- {
- $model = new \common\models\Characteristic();
- $rows = $model->getList([],['id','name']);
- if(!empty($rows))
- {
- return Help::JsonData(0,'成功',$model->Total(),$rows);
- }
- }
- /*
- * 资讯
- * */
- public function actionNews()
- {
- return $this->render('news',['type'=>Yii::$app->request->get('type')]);
- }
- /*
- * 资讯数据
- * */
- public function actionNewsform()
- {
- $model = new \common\models\News();
- $model->subject = Yii::$app->request->post('subject');
- $rows = $model->getList(Yii::$app->request->post());
- if(!empty($rows))
- {
- return Help::JsonData(0,'成功',$model->Total(),$rows);
- }
- }
- /*
- * 资讯 - 栏目
- * */
- public function actionNewscolumn()
- {
- return $this->render('newscolumn',['type'=>Yii::$app->request->get('type')]);
- }
- /*
- * 资讯 - 栏目数据
- * */
- public function actionNewscolumnform()
- {
- $model = new \common\models\CategoryNews();
- $input = Yii::$app->request->post();
- if(!empty($input['name']))
- {
- $model->news_name = $input['name'];
- }
- $rows = $model->getList($input,['id','news_name']);
- if(!empty($rows))
- {
- return Help::JsonData(0,'成功',$model->Total(),$rows);
- }
- }
- /*
- * 区域价格走势
- * */
- public function actionCityprice()
- {
- return $this->render('cityprice',['type'=>Yii::$app->request->get('type')]);
- }
- /*
- * 区域价格走势数据
- * */
- public function actionCitypriceform()
- {
- $model = new \common\models\Pricetrends();
- $rows = $model->getList(Yii::$app->request->post());
- if(!empty($rows))
- {
- return Help::JsonData(0,Yii::t('app','get_success'),$model->Total(),$rows);
- }
- return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
- }
- /**
- * 区域详情
- */
- public function actionCitydetails()
- {
- return $this->render('citydetails',['type'=>Yii::$app->request->get('type')]);
- }
- /**
- * 区域详情数据
- */
- public function actionCitydetailsform()
- {
- $model = new \common\models\CityDetails();
- $rows = $model->getList(Yii::$app->request->post());
- if(!empty($rows))
- {
- return Help::JsonData(0,Yii::t('app','get_success'),$model->Total(),$rows);
- }
- return Help::JsonCode(Help::ERROR,Yii::t('app','get_error'));
- }
- }
|