IndexpushController.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: LYY
  5. * Date: 2020/10/21
  6. * Time: 15:01
  7. */
  8. namespace backend\controllers\listnav;
  9. use Yii;
  10. use backend\base\CommonController;
  11. use backend\base\Help;
  12. use backend\server\ListnavServer;
  13. class IndexpushController extends CommonController
  14. {
  15. //列表状态信息设置
  16. public function actionSet()
  17. {
  18. $server = new ListnavServer();
  19. $state = $server->setList();
  20. return Help::JsonCode($state['code'], $state['msg']);
  21. }
  22. //=======================================推动区域信息===============================================================
  23. //首页推送地区导航栏位
  24. public function actionPushcity()
  25. {
  26. $list_id = Yii::$app->request->get('list_id');
  27. return $this->render('pushcity', ['list_id' => $list_id]);
  28. }
  29. public function actionPushcityform()
  30. {
  31. $server = new ListnavServer();
  32. $state = $server->getListCity();
  33. return Help::JsonData(0, $state['msg'], $state['count'], $state['data']);
  34. }
  35. //推送地区导航栏位添加
  36. public function actionAddpushcity()
  37. {
  38. $list_id = Yii::$app->request->get('list_id');
  39. return $this->render('pushcityadd', ['list_id' => $list_id]);
  40. }
  41. public function actionAddpushcityform()
  42. {
  43. $server = new ListnavServer();
  44. $state = $server->addListCity();
  45. return Help::JsonCode($state['code'], $state['msg']);
  46. }
  47. //=======================================================推送资讯信息===============================================
  48. public function actionPushnews()
  49. {
  50. $list_id = Yii::$app->request->get('list_id');
  51. return $this->render('pushnews', ['list_id' => $list_id]);
  52. }
  53. public function actionPushnewsform()
  54. {
  55. $server = new ListnavServer();
  56. $state = $server->getListNews();
  57. return Help::JsonData(0, $state['msg'], $state['count'], $state['data']);
  58. }
  59. public function actionPushnewsadd()
  60. {
  61. $list_id = Yii::$app->request->get('list_id');
  62. $newlist = (new ListnavServer())->getNewsList();
  63. return $this->render('pushnewsadd', ['list_id' => $list_id, 'new_list' => $newlist]);
  64. }
  65. public function actionPushnewsaddform()
  66. {
  67. $server = new ListnavServer();
  68. $state = $server->addListNews();
  69. return Help::JsonCode($state['code'], $state['msg']);
  70. }
  71. //=======================================================自定义导航烂推送位=========================================
  72. public function actionPushtitle()
  73. {
  74. $list_id = Yii::$app->request->get('list_id');
  75. return $this->render('pushtitle', ['list_id' => $list_id]);
  76. }
  77. public function actionPushtitleform()
  78. {
  79. $server = new ListnavServer();
  80. $state = $server->getListTitle();
  81. return Help::JsonData(0, $state['msg'], $state['count'], $state['data']);
  82. }
  83. public function actionPushtitleadd()
  84. {
  85. $list_id = Yii::$app->request->get('list_id');
  86. return $this->render('pushtitleadd', ['list_id' => $list_id]);
  87. }
  88. public function actionPushtitleaddform()
  89. {
  90. $server = new ListnavServer();
  91. $state = $server->addListTitle();
  92. return Help::JsonCode($state['code'], $state['msg']);
  93. }
  94. }