PushmController.php 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/13
  6. * Time: 上午8:46
  7. */
  8. namespace backend\controllers;
  9. use backend\base\CommonController;
  10. use backend\base\Help;
  11. use backend\server\NewsInformation;
  12. use common\models\CategoryCity;
  13. use common\models\Developers;
  14. use common\models\House;
  15. use common\models\PushmMansion;
  16. use Yii;
  17. use common\models\PushmRotation;
  18. use common\models\PushmVilla;
  19. use common\models\PushmMenu;
  20. use common\models\PushmRecommend;
  21. use common\models\PushChoice;
  22. use common\models\PushmHouse;
  23. use common\models\PushmCity;
  24. use common\models\PushmTimelimitsgroup;
  25. use common\models\PushmCharacteristic;
  26. use backend\server\UploadFile;
  27. /*
  28. * 热门区域 type = 1
  29. * 首页-拨打电话号码- 随机区域 type = 2
  30. *
  31. * */
  32. class PushmController extends CommonController
  33. {
  34. /*
  35. * 豪宅专区
  36. * */
  37. public function actionMansion ()
  38. {
  39. return $this->render( 'mansion' );
  40. }
  41. /*
  42. * 豪宅专区 - 数据
  43. * */
  44. public function actionMansionform ()
  45. {
  46. $model = new PushmMansion();
  47. $input = Yii::$app->request->post();
  48. $rows = $model->getList( $input );
  49. if ( $rows != null ) {
  50. $imgUrl = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'housealbum' ];
  51. foreach ( $rows as &$val ) {
  52. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  53. $val[ 'img' ] = $imgUrl . $val[ 'img' ];
  54. }
  55. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total( Yii::$app->request->post() ) , $rows );
  56. }
  57. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'get_error' ) );
  58. }
  59. /*
  60. * 豪宅专区 - 添加页面
  61. * */
  62. public function actionMansionadd ()
  63. {
  64. $developers = $this->Developers();
  65. return $this->render( 'mansionadd' , [ 'developers' => $developers ] );
  66. }
  67. /*
  68. * 豪宅专区 - 添加页面 - 添加数据
  69. * */
  70. public function actionMansionaddform ()
  71. {
  72. $model = new PushmMansion();
  73. $input = Yii::$app->request->post();
  74. if ( $input != null ) {
  75. $url = Yii::$app->params[ 'img_url' ][ 'housealbum' ];
  76. $img = UploadFile::InstanceImgName( 'img' , $url );
  77. if ( is_string( $img ) ) {
  78. $model->img = $img;
  79. }
  80. if ( $model->load( $input , '' ) && $model->save( false ) ) return Help::JsonCode( Help::SUCCESS , '添加成功' );
  81. }
  82. return Help::JsonCode( Help::ERROR , '添加失败' );
  83. }
  84. /*
  85. * 豪宅专区 - 修改页面
  86. * */
  87. public function actionMansionedit ()
  88. {
  89. $model = new PushmMansion();
  90. $input = Yii::$app->request->get();
  91. $row = $model->FindById( $input[ 'id' ] );
  92. if ( $row != null ) {
  93. $house = new House();
  94. $house = $house->FindById( $row[ 'hid' ] );
  95. $developers = $this->Developers();
  96. foreach ( $developers as &$val ) {
  97. $val[ 'checked' ] = '';
  98. if ( $val[ 'id' ] == $row[ 'did' ] ) {
  99. $val[ 'checked' ] = 'selected';
  100. }
  101. }
  102. $imgUrl = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'housealbum' ];
  103. $row[ 'img' ] = $imgUrl . $row[ 'img' ];
  104. return $this->render( 'mansionedit' , [ 'model' => $row , 'house' => $house , 'developers' => $developers ] );
  105. }
  106. }
  107. /*
  108. * 豪宅专区 - 修改页面 - 修改数据
  109. * */
  110. public function actionMansioneditform ()
  111. {
  112. $model = new PushmMansion();
  113. $input = Yii::$app->request->post();
  114. $row = $model->FindById( $input[ 'id' ] );
  115. if ( $row != null ) {
  116. $url = Yii::$app->params[ 'img_url' ][ 'housealbum' ];
  117. $img = UploadFile::InstanceImgName( 'img' , $url );
  118. if ( is_string( $img ) ) {
  119. UploadFile::delImg( $url , $row->img );
  120. $row->img = $img;
  121. }
  122. if ( $row->load( $input , '' ) && $row->update() == true ) return Help::JsonCode( Help::SUCCESS , '修改成功' );
  123. }
  124. return Help::JsonCode( Help::ERROR , '修改失败' );
  125. }
  126. /*
  127. * 豪宅专区 - 审核排序删除
  128. * */
  129. public function actionMansiondelshow ()
  130. {
  131. $model = new PushmMansion();
  132. $input = Yii::$app->request->post();
  133. $row = $model->FindById( $input[ 'id' ] );
  134. if ( $row != null ) {
  135. switch ( $input[ 'type' ] ) {
  136. case 'sort':
  137. $row->sort = $input[ 'sort' ];
  138. break;
  139. case 'show':
  140. if ( $row->is_show == 1 ) {
  141. $row->is_show = 2;
  142. } else {
  143. $row->is_show = 1;
  144. }
  145. break;
  146. case 'del':
  147. if ( !empty( $row->img ) ) {
  148. UploadFile::delImg( Yii::$app->params[ 'img_url' ][ 'housealbum' ] , $row->img );
  149. }
  150. if ( $row->delete() ) {
  151. return Help::JsonCode( Help::SUCCESS , '删除成功' );
  152. }
  153. break;
  154. }
  155. if ( $row->update( false ) ) return Help::JsonCode( Help::SUCCESS , '修改成功' );
  156. }
  157. return Help::JsonCode( Help::ERROR , '修改失败' );
  158. }
  159. /*
  160. * 豪宅专区 - 批量删除
  161. * */
  162. public function actionMansiondelall ()
  163. {
  164. $input = Yii::$app->request->post();
  165. $model = PushmMansion::find()->where( [ 'in' , 'id' , $input[ 'id' ] ] )->all();
  166. $delall = PushmMansion::deleteAll( [ 'id' => $input[ 'id' ] ] );
  167. if ( $delall ) {
  168. foreach ( $model as $value ) {
  169. UploadFile::delImg( Yii::$app->params[ 'img_url' ][ 'housealbum' ] , $value[ 'img' ] );
  170. }
  171. return Help::JsonCode( Help::SUCCESS , '批量删除成功' );
  172. }
  173. return Help::JsonCode( Help::ERROR , '批量删除失败' );
  174. }
  175. /*
  176. * 推送首页轮播
  177. * */
  178. public function actionRotation ()
  179. {
  180. $city = $this->City();
  181. return $this->render( 'rotation' , [ 'city' => $city ] );
  182. }
  183. /*
  184. * 推送首页轮播数据
  185. * */
  186. public function actionRotationforms ()
  187. {
  188. $model = new PushmRotation();
  189. $rows = $model->getList( Yii::$app->request->post() );
  190. if ( $rows != null ) {
  191. $imgUrl = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'push_lb' ];
  192. foreach ( $rows as &$val ) {
  193. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  194. $val[ 'img' ] = $imgUrl . $val[ 'img' ];
  195. }
  196. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total( Yii::$app->request->post() ) , $rows );
  197. }
  198. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'get_error' ) );
  199. }
  200. /*
  201. * 推送首页轮播 - 添加页面
  202. */
  203. public function actionRotationadd ()
  204. {
  205. $cityModel = $this->City();
  206. return $this->render( 'rotationadd' , [ 'city' => $cityModel ] );
  207. }
  208. /*
  209. * 推送首页轮播 - 添加数据
  210. */
  211. public function actionRotationform ()
  212. {
  213. try {
  214. $model = new PushmRotation();
  215. $input = Yii::$app->request->post();
  216. $url = Yii::$app->params[ 'img_url' ][ 'push_lb' ];
  217. $img = UploadFile::InstanceImgName_v1( 'img' , $url );
  218. if ( is_string( $img ) ) {
  219. $input[ 'img' ] = $img;
  220. }
  221. $model->load( $input , '' );
  222. if ( $model->save() ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  223. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_error' ) , $model->errors );
  224. } catch ( \Exception $e ) {
  225. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_error' ) , $e->getMessage() );
  226. }
  227. }
  228. /*
  229. * 推送首页轮播 - 修改
  230. */
  231. public function actionRotationedit ()
  232. {
  233. $model = new PushmRotation();
  234. $input = Yii::$app->request->get();
  235. $row = $model->FindById( $input[ 'id' ] );
  236. if ( $row != null ) {
  237. $imgUrl = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'push_lb' ];
  238. $row[ 'img' ] = $imgUrl . $row[ 'img' ];
  239. $cityModel = $this->City();
  240. foreach ( $cityModel as &$val ) {
  241. $val[ 'checked' ] = '';
  242. if ( $val[ 'id' ] == $row[ 'city' ] ) {
  243. $val[ 'checked' ] = 'selected';
  244. }
  245. }
  246. return $this->render( 'rotationedit' , [ 'model' => $row , 'city' => $cityModel ] );
  247. }
  248. }
  249. /*
  250. * 推送首页轮播 - 修改数据
  251. * */
  252. public function actionRotationeditform ()
  253. {
  254. $model = new PushmRotation();
  255. $input = Yii::$app->request->post();
  256. $setAttribute = $model->Authenticator( $input );
  257. if ( is_object( $setAttribute ) ) {
  258. $row = $model->FindById( $input[ 'id' ] );
  259. if ( $row != null ) {
  260. $row = Help::SetAttr( $input , $model , $row );
  261. $url = Yii::$app->params[ 'img_url' ][ 'push_lb' ];
  262. $img = UploadFile::InstanceImgName( 'img' , $url );
  263. if ( is_string( $img ) ) {
  264. UploadFile::delImg( $url , $row->img );
  265. $row->img = $img;
  266. }
  267. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  268. }
  269. }
  270. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) , $setAttribute );
  271. }
  272. /*
  273. * 推送首页轮播 - 删除 and 禁用
  274. * */
  275. public function actionImgdelshow ()
  276. {
  277. $model = new PushmRotation();
  278. $input = Yii::$app->request->post();
  279. $row = $model->FindById( $input[ 'id' ] );
  280. if ( $row != null ) {
  281. switch ( $input[ 'type' ] ) {
  282. case 'show':
  283. if ( $row->is_show == 1 ) {
  284. $row->is_show = 2;
  285. } else if ( $row->is_show == 2 ) {
  286. $row->is_show = 1;
  287. }
  288. break;
  289. case 'sort':
  290. if ( is_numeric( $input[ 'sort' ] ) ) {
  291. $row->sort = $input[ 'sort' ];
  292. }
  293. break;
  294. case 'del':
  295. if ( $row->delete() ) {
  296. UploadFile::delImg( Yii::$app->params[ 'img_url' ][ 'push_lb' ] , $row->img );
  297. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  298. }
  299. break;
  300. case 'expiration':
  301. $row->expiration_date = $input[ 'expiration' ];
  302. break;
  303. }
  304. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  305. }
  306. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  307. }
  308. /******************************豪宅楼盘*************************************/
  309. /*
  310. * 推送首页轮播
  311. * */
  312. public function actionVilla ()
  313. {
  314. return $this->render( 'villa' );
  315. }
  316. /*
  317. * 推送首页轮播数据
  318. * */
  319. public function actionVillaforms ()
  320. {
  321. $model = new PushmVilla();
  322. $rows = $model->getList( Yii::$app->request->post() );
  323. if ( $rows != null ) {
  324. $imgUrl = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'villa' ];
  325. foreach ( $rows as &$val ) {
  326. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  327. $val[ 'img' ] = $imgUrl . $val[ 'img' ];
  328. }
  329. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total() , $rows );
  330. }
  331. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'get_error' ) );
  332. }
  333. /*
  334. * 推送首页轮播 - 添加页面
  335. */
  336. public function actionVillaadd ()
  337. {
  338. $cityModel = $this->City();
  339. $developers = $this->Developers();
  340. return $this->render( 'villaadd' , [ 'city' => $cityModel , 'developers' => $developers ] );
  341. }
  342. /*
  343. * 推送首页轮播 - 添加数据
  344. */
  345. public function actionVillaform ()
  346. {
  347. $model = new PushmVilla();
  348. $input = Yii::$app->request->post();
  349. $model = $model->Authenticator( $input );
  350. if ( is_object( $model ) ) {
  351. $url = Yii::$app->params[ 'img_url' ][ 'villa' ];
  352. $img = UploadFile::InstanceImgName( 'img' , $url );
  353. if ( is_string( $img ) ) {
  354. $model->img = $img;
  355. //压缩图片
  356. $compressParams = [];
  357. $compressParams[ 'data' ][ 'imgname' ] = $img;;
  358. $compressParams[ 'data' ][ 'url' ] = $url;
  359. $compressParams[ 'data' ][ 'source' ] = '移动端推送位,首页热门活动@添加';
  360. $ya = new \backend\event\TinifyEvent();
  361. $ya->CompressImg( $compressParams );
  362. }
  363. if ( $model->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  364. }
  365. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_error' ) , $model );
  366. }
  367. /*
  368. * 推送首页轮播 - 修改
  369. */
  370. public function actionVillaedit ()
  371. {
  372. $model = new PushmVilla();
  373. $input = Yii::$app->request->get();
  374. $row = $model->FindById( $input[ 'id' ] );
  375. if ( $row != null ) {
  376. $imgUrl = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'villa' ];
  377. $row[ 'img' ] = $imgUrl . $row[ 'img' ];
  378. $cityModel = $this->City();
  379. $developers = $this->Developers();
  380. foreach ( $cityModel as &$val ) {
  381. $val[ 'checked' ] = '';
  382. if ( $val[ 'id' ] == $row[ 'city' ] ) {
  383. $val[ 'checked' ] = 'selected';
  384. }
  385. }
  386. foreach ( $developers as &$val ) {
  387. $val[ 'checked' ] = '';
  388. if ( $val[ 'id' ] == $row[ 'developers' ] ) {
  389. $val[ 'checked' ] = 'selected';
  390. }
  391. }
  392. return $this->render( 'villaedit' , [ 'model' => $row , 'city' => $cityModel , 'developers' => $developers ] );
  393. }
  394. }
  395. /*
  396. * 推送首页轮播 - 修改数据
  397. * */
  398. public function actionVillaeditform ()
  399. {
  400. $model = new PushmVilla();
  401. $input = Yii::$app->request->post();
  402. $setAttribute = $model->Authenticator( $input );
  403. if ( is_object( $setAttribute ) ) {
  404. $row = $model->FindById( $input[ 'id' ] );
  405. if ( $row != null ) {
  406. $row = Help::SetAttr( $input , $model , $row );
  407. $url = Yii::$app->params[ 'img_url' ][ 'villa' ];
  408. $img = UploadFile::InstanceImgName( 'img' , $url );
  409. if ( is_string( $img ) ) {
  410. UploadFile::delImg( $url , $row->img );
  411. $row->img = $img;
  412. //压缩图片
  413. $compressParams = [];
  414. $compressParams[ 'data' ][ 'imgname' ] = $img;;
  415. $compressParams[ 'data' ][ 'url' ] = $url;
  416. $compressParams[ 'data' ][ 'source' ] = '移动端推送位,首页热门活动@修改';
  417. $ya = new \backend\event\TinifyEvent();
  418. $ya->CompressImg( $compressParams );
  419. }
  420. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  421. }
  422. }
  423. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) , $setAttribute );
  424. }
  425. /*
  426. * 推送首页轮播 - 删除 and 禁用
  427. * */
  428. public function actionVillaimgdelshow ()
  429. {
  430. $model = new PushmVilla();
  431. $input = Yii::$app->request->post();
  432. $row = $model->FindById( $input[ 'id' ] );
  433. if ( $row != null ) {
  434. switch ( $input[ 'type' ] ) {
  435. case 'show':
  436. if ( $row->is_show == 1 ) {
  437. $row->is_show = 2;
  438. } else if ( $row->is_show == 2 ) {
  439. $row->is_show = 1;
  440. }
  441. break;
  442. case 'del':
  443. $row->del = 2;
  444. break;
  445. }
  446. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  447. }
  448. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  449. }
  450. /******************************豪宅楼盘*************************************/
  451. /*
  452. * 首页-品房推荐 -列表
  453. * */
  454. public function actionRecommend ()
  455. {
  456. return $this->render( 'recommend' );
  457. }
  458. public function actionRecommendform ()
  459. {
  460. $model = new PushmRecommend();
  461. $input = Yii::$app->request->post();
  462. $rows = $model->getList( $input );
  463. if ( $rows != null ) {
  464. foreach ( $rows as &$val ) {
  465. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  466. }
  467. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total() , $rows );
  468. }
  469. return Help::JsonData( Help::ERROR , Yii::t( 'app' , 'get_error' ) , 0 );
  470. }
  471. /*
  472. * 移动端导航推荐
  473. * */
  474. public function actionMenu ()
  475. {
  476. return $this->render( 'menu' );
  477. }
  478. /*
  479. * 推送移动端导航推荐
  480. * */
  481. public function actionMenuforms ()
  482. {
  483. $model = new PushmMenu();
  484. $rows = $model->getList( Yii::$app->request->post() );
  485. if ( $rows != null ) {
  486. foreach ( $rows as &$val ) {
  487. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  488. }
  489. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total() , $rows );
  490. }
  491. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'get_error' ) );
  492. }
  493. /*
  494. * 推送移动端导航推荐 - 添加页面
  495. */
  496. public function actionMenuadd ()
  497. {
  498. $cityModel = $this->City();
  499. $menu = $this->parentMenu();
  500. return $this->render( 'menuadd' , [ 'city' => $cityModel , 'menu' => $menu ] );
  501. }
  502. //*获取父级菜单*/
  503. private function parentMenu ()
  504. {
  505. $frontend = new \common\models\Frontend();
  506. //$menu=$frontend->PidList(0)
  507. return $frontend->PidList( 0 );
  508. }
  509. /*
  510. * 推送移动端导航推荐
  511. */
  512. public function actionMenuform ()
  513. {
  514. $model = new PushmMenu();
  515. $input = Yii::$app->request->post();
  516. $model = $model->Authenticator( $input );
  517. if ( is_object( $model ) ) {
  518. if ( $model->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  519. }
  520. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_error' ) , $model );
  521. }
  522. public function actionMenudel ()
  523. {
  524. $model = new PushmMenu();
  525. $input = Yii::$app->request->post();
  526. $row = $model->FindById( $input[ 'id' ] );
  527. if ( $row != null ) {
  528. switch ( $input[ 'type' ] ) {
  529. case 'del':
  530. $row->del = 2;
  531. break;
  532. }
  533. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  534. }
  535. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  536. }
  537. /*
  538. * 首页-品房推荐 - 添加页面
  539. */
  540. public function actionRecommendadd ()
  541. {
  542. return $this->render( 'recommendadd' );
  543. }
  544. /*
  545. * 首页-品房推荐 - 添加数据
  546. * */
  547. public function actionRecommendaddform ()
  548. {
  549. $model = new PushmRecommend();
  550. $input = Yii::$app->request->post();
  551. $auth = $model->Authenticator( $input );
  552. if ( is_object( $auth ) ) {
  553. // $url = Yii::$app->params['img_url']['hot_activity'];
  554. // $img = UploadFile::InstanceImgName('img',$url);
  555. // if(is_string($img))
  556. // {
  557. // $auth->img = $img;
  558. // }
  559. if ( $auth->save() ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  560. }
  561. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'add_error' ) , $auth );
  562. }
  563. /*
  564. * 首页-品房推荐 - 修改页面
  565. */
  566. public function actionRecommendedit ()
  567. {
  568. $model = new PushmRecommend();
  569. $row = $model->FindById( Yii::$app->request->get( 'id' ) );
  570. if ( $row != null ) {
  571. return $this->render( 'recommendedit' , [ 'model' => $row ] );
  572. }
  573. }
  574. /*
  575. * 首页-品房推荐 - 修改数据
  576. * */
  577. public function actionRecommendeditform ()
  578. {
  579. $model = new PushmRecommend();
  580. $input = Yii::$app->request->post();
  581. $setAttribute = $model->Authenticator( $input );
  582. if ( is_object( $setAttribute ) ) {
  583. $row = $model->FindById( $input[ 'id' ] );
  584. if ( $row != null ) {
  585. $row = Help::SetAttr( $input , $model , $row );
  586. if ( $row->save() ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  587. }
  588. }
  589. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) , $setAttribute );
  590. }
  591. /*
  592. * 首页-品房推荐 - 删除 and 禁用
  593. * */
  594. public function actionRecommenddelshow ()
  595. {
  596. $model = new PushmRecommend();
  597. $input = Yii::$app->request->post();
  598. $row = $model->FindById( $input[ 'id' ] );
  599. if ( $row != null ) {
  600. switch ( $input[ 'type' ] ) {
  601. case 'show':
  602. if ( $row->is_show == 1 ) {
  603. $row->is_show = 2;
  604. } else if ( $row->is_show == 2 ) {
  605. $row->is_show = 1;
  606. }
  607. break;
  608. case 'del':
  609. $row->del = 2;
  610. break;
  611. }
  612. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  613. }
  614. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  615. }
  616. /*
  617. * 首页-热销楼盘
  618. * */
  619. public function actionHotsale ()
  620. {
  621. return $this->render( 'hotsale' , [ 'type' => 1 ] );
  622. }
  623. /*
  624. * 首页-热销楼盘 - 数据
  625. * */
  626. public function actionHotsaleform ()
  627. {
  628. $model = new PushmHouse();
  629. $input = Yii::$app->request->post();
  630. if ( !empty( $input[ 'city_id' ] ) ) {
  631. $input[ 'city_id' ] = explode( ',' , $input[ 'city_id' ] );
  632. }
  633. $result = $model->getList( $input );
  634. if ( $result != null ) {
  635. foreach ( $result as &$val ) {
  636. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  637. }
  638. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Totalhotsalefeng( $input ) , $result );
  639. }
  640. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'get_error' ) );
  641. }
  642. /*
  643. * 首页-热销楼盘 - 添加
  644. */
  645. public function actionHotsaleadd ()
  646. {
  647. return $this->render( 'hotsaleadd' , [ 'type' => Yii::$app->request->get( 'type' ) ] );
  648. }
  649. /*
  650. * 首页-热销楼盘 - 添加数据
  651. */
  652. public function actionHotsaleaddform ()
  653. {
  654. $input = Yii::$app->request->post();
  655. $model = new PushmHouse();
  656. $model->scenario = 'add';
  657. $validate = $model->Authenticator( $input );
  658. if ( is_object( $validate ) ) {
  659. if ( $validate->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  660. }
  661. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'add_error' ) , $validate );
  662. }
  663. /*
  664. * 首页-热销楼盘- - 删除 and 禁用
  665. * */
  666. public function actionSaledelshow ()
  667. {
  668. $model = new PushmHouse();
  669. $input = Yii::$app->request->post();
  670. $row = $model->FindById( $input[ 'id' ] );
  671. if ( $row != null ) {
  672. switch ( $input[ 'type' ] ) {
  673. case 'show':
  674. if ( $row->is_show == 1 ) {
  675. $row->is_show = 2;
  676. } else if ( $row->is_show == 2 ) {
  677. $row->is_show = 1;
  678. }
  679. break;
  680. case 'del':
  681. $row->del = 2;
  682. break;
  683. case 'sort':
  684. if ( is_numeric( $input[ 'sort' ] ) ) {
  685. $row->sort = $input[ 'sort' ];
  686. }
  687. break;
  688. }
  689. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  690. }
  691. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  692. }
  693. /*
  694. * 首页-热销楼盘- 批量删除
  695. * */
  696. public function actionHotsaledelall ()
  697. {
  698. $input = Yii::$app->request->post();
  699. $delall = PushmHouse::deleteAll( [ 'id' => $input[ 'id' ] ] );
  700. if ( $delall ) {
  701. return Help::JsonCode( Help::SUCCESS , '批量删除成功' );
  702. }
  703. return Help::JsonCode( Help::ERROR , '批量删除失败' );
  704. }
  705. /*
  706. * 搜索框 - 热门筛选
  707. * */
  708. public function actionHotscreen ()
  709. {
  710. return $this->render( 'hotsale' , [ 'type' => 2 ] );
  711. }
  712. /*
  713. * 首页 - 精选楼盘
  714. * */
  715. public function actionHotselected ()
  716. {
  717. return $this->render( 'hotsale' , [ 'type' => 4 , 'city_id' => Yii::$app->request->get( 'city_id' ) ] );
  718. }
  719. /*
  720. *首页-热门地区
  721. * */
  722. public function actionHotcity ()
  723. {
  724. return $this->render( 'hotcity' , [ 'type' => 1 ] );
  725. }
  726. /*
  727. * 首页-热门区域-数据列表
  728. * */
  729. public function actionHotcityform ()
  730. {
  731. $model = new PushmCity();
  732. $input = Yii::$app->request->post();
  733. $model->type = $input[ 'type' ];
  734. $rows = $model->getList( $input );
  735. if ( !empty( $rows ) ) {
  736. foreach ( $rows as &$val ) {
  737. $val[ 'img' ] = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'city' ] . $val[ 'img' ];
  738. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  739. }
  740. return Help::JsonData( 0 , '成功' , $model->Total() , $rows );
  741. }
  742. }
  743. /*
  744. * 首页-热门区域-数据列表
  745. * */
  746. public function actionHotcityadd ()
  747. {
  748. $cityModel = ( new CategoryCity() )->SortgetList( [] );
  749. return $this->render( 'hotcityadd' , [ 'type' => Yii::$app->request->get( 'type' ) , 'city' => $cityModel ] );
  750. }
  751. /*
  752. * 首页-热门区域-数据列表
  753. * */
  754. public function actionHotcityaddform ()
  755. {
  756. $model = new PushmCity();
  757. $input = Yii::$app->request->post();
  758. $model->scenario = 'add';
  759. $auth = $model->Authenticator( $input );
  760. if ( is_object( $auth ) ) {
  761. $img = UploadFile::InstanceImgName( 'img' , Yii::$app->params[ 'img_url' ][ 'city' ] );
  762. if ( is_string( $img ) ) {
  763. $auth->img = $img;
  764. }
  765. if ( $auth->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  766. }
  767. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'add_error' ) , $auth );
  768. }
  769. /*
  770. * 热门区域- 修改
  771. */
  772. public function actionHotcityedit ()
  773. {
  774. $model = new PushmCity();
  775. $input = Yii::$app->request->get();
  776. $row = $model->FindById( $input[ 'id' ] );
  777. if ( $row != null ) {
  778. $cityModel = ( new CategoryCity() )->SortgetList( [] );
  779. foreach ( $cityModel as &$val ) {
  780. $val[ 'checked' ] = '';
  781. if ( $val[ 'id' ] == $row[ 'city_id' ] ) {
  782. $val[ 'checked' ] = 'selected';
  783. }
  784. }
  785. return $this->render( 'hotcityedit' , [ 'model' => $row , 'city' => $cityModel ] );
  786. }
  787. }
  788. /*
  789. * 推送首页轮播 - 修改数据
  790. * */
  791. public function actionHotcityeditform ()
  792. {
  793. $model = new PushmCity();
  794. $input = Yii::$app->request->post();
  795. $setAttribute = $model->Authenticator( $input );
  796. if ( is_object( $setAttribute ) ) {
  797. $row = $model->FindById( $input[ 'id' ] );
  798. if ( $row != null ) {
  799. $row = Help::SetAttr( $input , $model , $row );
  800. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  801. }
  802. }
  803. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) , $setAttribute );
  804. }
  805. /*
  806. * 首页-精选 - 删除 and 禁用
  807. * */
  808. public function actionCitydelshow ()
  809. {
  810. $model = new PushmCity();
  811. $input = Yii::$app->request->post();
  812. $row = $model->FindById( $input[ 'id' ] );
  813. if ( $row != null ) {
  814. switch ( $input[ 'type' ] ) {
  815. case 'show':
  816. if ( $row->is_show == 1 ) {
  817. $row->is_show = 2;
  818. } else if ( $row->is_show == 2 ) {
  819. $row->is_show = 1;
  820. }
  821. break;
  822. case 'del':
  823. if ( !empty( $row->img ) ) {
  824. UploadFile::delImg( Yii::$app->params[ 'img_url' ][ 'city' ] , $row->img );
  825. }
  826. if ( $row->delete() ) {
  827. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  828. }
  829. break;
  830. case 'sort':
  831. if ( !is_numeric( $input[ 'sort' ] ) ) {
  832. return Help::JsonCode( Help::ERROR , '请输入数字' );
  833. }
  834. $row->sort = $input[ 'sort' ];
  835. break;
  836. }
  837. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  838. }
  839. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  840. }
  841. /*
  842. * 首页-特色类型 页面
  843. * */
  844. public function actionCharacteristic ()
  845. {
  846. return $this->render( 'characteristic' );
  847. }
  848. /*
  849. * 首页-特色类型 数据
  850. * */
  851. public function actionCharacteristicform ()
  852. {
  853. $model = new PushmCharacteristic();
  854. $input = Yii::$app->request->post();
  855. $rows = $model->getList( $input );
  856. if ( !empty( $rows ) ) {
  857. $url = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'characteristic' ];
  858. foreach ( $rows as &$val ) {
  859. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  860. $val[ 'img' ] = $url . $val[ 'img' ];
  861. }
  862. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total() , $rows );
  863. }
  864. }
  865. /*
  866. * 首页-特色类型 添加页面
  867. * */
  868. public function actionCharacteristicadd ()
  869. {
  870. return $this->render( 'characteristicadd' );
  871. }
  872. /*
  873. * 首页-特色类型 添加页面
  874. * */
  875. public function actionCharacteristicaddform ()
  876. {
  877. $model = new PushmCharacteristic();
  878. $input = Yii::$app->request->post();
  879. $auth = $model->Authenticator( $input );
  880. if ( is_object( $auth ) ) {
  881. $url = Yii::$app->params[ 'img_url' ][ 'characteristic' ];
  882. $imgStr = UploadFile::InstanceImgName( 'img' , $url );
  883. if ( is_string( $imgStr ) ) {
  884. $auth->img = $imgStr;
  885. }
  886. if ( $auth->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  887. }
  888. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'add_error' ) , $auth );
  889. }
  890. /*
  891. * 首页-特色类型 修改页面
  892. * */
  893. public function actionCharacteristicedit ()
  894. {
  895. $model = new PushmCharacteristic();
  896. $row = $model->FindById( Yii::$app->request->get( 'id' ) );
  897. if ( $row != null ) {
  898. $row[ 'img' ] = Yii::$app->params[ 'httpImg' ][ 'host' ] . Yii::$app->params[ 'httpImg' ][ 'characteristic' ] . $row[ 'img' ];
  899. return $this->render( 'characteristicedit' , [ 'model' => $row , 'get' => Yii::$app->request->get() ] );
  900. }
  901. }
  902. /*
  903. * 首页-特色类型 修改页面
  904. * */
  905. public function actionCharacteristiceditform ()
  906. {
  907. $model = new PushmCharacteristic();
  908. $input = Yii::$app->request->post();
  909. $auth = $model->Authenticator( $input );
  910. if ( is_object( $auth ) ) {
  911. $row = $model->FindById( $input[ 'id' ] );
  912. if ( !empty( $row ) ) {
  913. $url = Yii::$app->params[ 'img_url' ][ 'characteristic' ];
  914. $imgStr = UploadFile::InstanceImgName( 'img' , $url );
  915. $result = Help::SetAttr( $input , $auth , $row );
  916. if ( is_string( $imgStr ) ) {
  917. UploadFile::delImg( $url , $row[ 'img' ] );
  918. $result->img = $imgStr;
  919. }
  920. if ( $result->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  921. }
  922. }
  923. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) , $auth );
  924. }
  925. /*
  926. * 首页-特色类型 - 删除 and 禁用
  927. * */
  928. public function actionCharacteristicdelshow ()
  929. {
  930. $model = new PushmCharacteristic();
  931. $input = Yii::$app->request->post();
  932. $row = $model->FindById( $input[ 'id' ] );
  933. if ( $row != null ) {
  934. switch ( $input[ 'type' ] ) {
  935. case 'show':
  936. if ( $row->is_show == 1 ) {
  937. $row->is_show = 2;
  938. } else if ( $row->is_show == 2 ) {
  939. $row->is_show = 1;
  940. }
  941. break;
  942. case 'del':
  943. if ( !empty( $row->img ) ) {
  944. UploadFile::delImg( Yii::$app->params[ 'img_url' ][ 'characteristic' ] , $row->img );
  945. }
  946. if ( $row->delete() ) {
  947. return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  948. }
  949. break;
  950. case 'sort':
  951. if ( !is_numeric( $input[ 'sort' ] ) ) {
  952. return Help::JsonCode( Help::ERROR , '请输入数字' );
  953. }
  954. $row->sort = $input[ 'sort' ];
  955. break;
  956. }
  957. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  958. }
  959. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  960. }
  961. /*
  962. * 首页 - 拨打电话图标 随机区域里面的电话号码
  963. * */
  964. public function actionRandcity ()
  965. {
  966. return $this->render( 'randcity' , [ 'type' => 2 ] );
  967. }
  968. /*
  969. * 首页 - 拨打电话 数据
  970. * */
  971. public function actionRandcityform ()
  972. {
  973. $model = new PushmCity();
  974. $input = Yii::$app->request->post();
  975. $model->type = $input[ 'type' ];
  976. $rows = $model->getList( $input );
  977. if ( !empty( $rows ) ) {
  978. foreach ( $rows as &$val ) {
  979. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  980. }
  981. return Help::JsonData( 0 , '成功' , $model->Total() , $rows );
  982. }
  983. }
  984. /*
  985. * 首页 - 拨打电话 添加页面
  986. * */
  987. public function actionRandcityadd ()
  988. {
  989. return $this->render( 'randcityadd' , [ 'type' => Yii::$app->request->get( 'type' ) ] );
  990. }
  991. /*
  992. * 首页 - 拨打电话 添加数据
  993. * */
  994. public function actionRandcityaddform ()
  995. {
  996. }
  997. /********限时团购*********/
  998. public function actionTimelimitsgroup ()
  999. {
  1000. $cityModel = $this->City();
  1001. return $this->render( 'timelimitsgroup' , [ 'type' => 1 , 'city' => $cityModel ] );
  1002. }
  1003. public function actionTimelimitsgroupform ()
  1004. {
  1005. $model = new PushmTimelimitsgroup();
  1006. $input = Yii::$app->request->post();
  1007. $result = $model->getList( $input );
  1008. if ( $result != null ) {
  1009. foreach ( $result as &$val ) {
  1010. $val[ 'create_at' ] = date( 'Y-m-d H:i' , $val[ 'create_at' ] );
  1011. }
  1012. return Help::JsonData( 0 , Yii::t( 'app' , 'get_success' ) , $model->Total( $input ) , $result );
  1013. }
  1014. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'get_error' ) );
  1015. }
  1016. public function actionTimelimitsgroupadd ()
  1017. {
  1018. $cityModel = $this->City();
  1019. return $this->render( 'timelimitsgroupadd' , [ 'type' => Yii::$app->request->get( 'type' ) , 'city' => $cityModel ] );
  1020. }
  1021. public function actionTimelimitsgroupaddform ()
  1022. {
  1023. $input = Yii::$app->request->post();
  1024. $model = new PushmTimelimitsgroup();
  1025. $model->scenario = 'add';
  1026. $validate = $model->Authenticator( $input );
  1027. if ( is_object( $validate ) ) {
  1028. if ( $validate->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'add_success' ) );
  1029. }
  1030. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'add_error' ) , $validate );
  1031. }
  1032. /*
  1033. * 首页 - 修改页面
  1034. */
  1035. public function actionTimelimitsgroupedit ()
  1036. {
  1037. $model = new PushmTimelimitsgroup();
  1038. $cityModel = $this->City();
  1039. $row = $model->FindById( Yii::$app->request->get( 'id' ) );
  1040. if ( $row != null ) {
  1041. return $this->render( 'timelimitsgroupedit' , [ 'type' => Yii::$app->request->get( 'type' ) , 'row' => $row , 'house_name' => Yii::$app->request->get( 'house_name' ) , 'city' => $cityModel ] );
  1042. }
  1043. }
  1044. /*
  1045. * 显示抢购 修改数据
  1046. * */
  1047. public function actionTimelimitsgroupeditform ()
  1048. {
  1049. $model = new PushmTimelimitsgroup();
  1050. $input = Yii::$app->request->post();
  1051. $setAttribute = $model->Authenticator( $input );
  1052. if ( is_object( $setAttribute ) ) {
  1053. $row = $model->FindById( $input[ 'id' ] );
  1054. if ( $row != null ) {
  1055. $row = Help::SetAttr( $input , $model , $row );
  1056. if ( $row->save() ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  1057. }
  1058. }
  1059. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) , $setAttribute );
  1060. }
  1061. /*排序 删除 显示*/
  1062. public function actionTimelimitsgroupdelandshow ()
  1063. {
  1064. $model = new PushmTimelimitsgroup();
  1065. $input = Yii::$app->request->post();
  1066. $row = $model->FindById( $input[ 'id' ] );
  1067. if ( $row != null ) {
  1068. switch ( $input[ 'type' ] ) {
  1069. case 'show':
  1070. if ( $row->is_show == 1 ) {
  1071. $row->is_show = 2;
  1072. } else if ( $row->is_show == 2 ) {
  1073. $row->is_show = 1;
  1074. }
  1075. break;
  1076. case 'del':
  1077. $row->del = 2;
  1078. break;
  1079. case 'sort':
  1080. $row->sort = $input[ 'sort' ];
  1081. break;
  1082. case 'click':
  1083. $row->click = $input[ 'click' ];
  1084. break;
  1085. case 'group_num':
  1086. $row->group_num = $input[ 'group_num' ];
  1087. break;
  1088. }
  1089. if ( $row->save( false ) ) return Help::JsonCode( Help::SUCCESS , Yii::t( 'app' , 'edit_success' ) );
  1090. }
  1091. return Help::JsonCode( Help::ERROR , Yii::t( 'app' , 'edit_error' ) );
  1092. }
  1093. private function Developers ()
  1094. {
  1095. $developers = new \common\models\Developers();
  1096. $developers->is_del = 1;
  1097. $developers = $developers->getList( [] );
  1098. return $developers;
  1099. }
  1100. private function City ()
  1101. {
  1102. $city = new \common\models\CategoryCity();
  1103. $city->state = 1;
  1104. $city->pid = 0;
  1105. $cityModel = $city->getList( [] );
  1106. return $cityModel;
  1107. }
  1108. public function actionHothouse ()
  1109. {
  1110. return $this->render( 'hothouse' , [ 'type' => 1 ] );
  1111. }
  1112. /**
  1113. * 添加推送楼盘
  1114. * @return string
  1115. */
  1116. public function actionHothouseadd ()
  1117. {
  1118. return $this->render( 'hothouseadd' , [ 'type' => Yii::$app->request->get( 'type' ) ] );
  1119. }
  1120. }