ListpushpcController.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * @author Lyy
  4. * @version v3改版 推送类型数据控制器
  5. */
  6. namespace backend\controllers;
  7. use backend\base\CommonController;
  8. use backend\server\Listclassnevserver;
  9. use backend\base\Help;
  10. use Yii;
  11. class ListpushpcController extends CommonController
  12. {
  13. //定义操作类
  14. protected $Listclassnevserver = null;
  15. /**
  16. * 初始化方法
  17. * */
  18. public function beforeAction($action)
  19. {
  20. $this->Listclassnevserver = new Listclassnevserver();
  21. return parent::beforeAction($action);
  22. }
  23. /**
  24. * 自定义类目获取数据统一接口
  25. * @access public
  26. * @param type 获取类目数据的类别
  27. * @return array []
  28. * */
  29. public function actionNevlistdataget()
  30. {
  31. $input = Yii::$app->request->post();
  32. $data = $this->Listclassnevserver->getTypeListData($input);
  33. return Help::JsonData(0, $data['msg'], $data['count'], $data['data']);
  34. }
  35. /********************************************品质新房 begin*******************************************************/
  36. /**
  37. *品质新房 character new house
  38. * @access public
  39. * @return file 加载列表数据页面
  40. * 品质新房后台列表页面加载
  41. * */
  42. public function actionNevlistcharacter()
  43. {
  44. $type_id = Yii::$app->request->get('type_id');
  45. return $this->render('character', ['type_id' => $type_id]);
  46. }
  47. /**
  48. *数据添加
  49. * */
  50. public function actionNevlistcharacteradd()
  51. {
  52. $type_id = Yii::$app->request->get('type_id');
  53. return $this->render('characteradd', ['type_id' => $type_id]);
  54. }
  55. /**
  56. *数据编辑
  57. * */
  58. public function actionNevlistcharacteredit()
  59. {
  60. $id = Yii::$app->request->get('id');
  61. $row = $this->Listclassnevserver->GetListHouseOne($id);
  62. return $this->render('characteredit', ['row' => $row]);
  63. }
  64. /**
  65. *执行数据添加
  66. */
  67. public function actionNevlistcharacteraddform()
  68. {
  69. $input = Yii::$app->request->post();
  70. $state = $this->Listclassnevserver->addListData($input);
  71. if ($state === true) return Help::JsonCode(Help::SUCCESS, '添加完成');
  72. return Help::JsonCode(Help::SUCCESS, $state);
  73. }
  74. /**
  75. *执行数据编辑
  76. */
  77. public function actionNevlistcharactereditform()
  78. {
  79. $input = Yii::$app->request->post();
  80. $state = $this->Listclassnevserver->editListData($input);
  81. if ($state) return Help::JsonCode(Help::SUCCESS, '编辑完成');
  82. return Help::JsonCode(Help::SUCCESS, '编辑失败');
  83. }
  84. /**
  85. * 数据设置
  86. * */
  87. public function actionNevlistcharacterset()
  88. {
  89. $input = Yii::$app->request->post();
  90. $state = $this->Listclassnevserver->setListData($input);
  91. if ($state) return Help::JsonCode(Help::SUCCESS, '设置完成');
  92. return Help::JsonCode(Help::SUCCESS, '设置失败');
  93. }
  94. /********************************************品质新房 end*******************************************************/
  95. }