1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace backend\controllers\listnews;
- use Yii;
- use backend\base\CommonController;
- use backend\base\Help;
- use backend\server\ListnewsServer;
- class IndexpushController extends CommonController
- {
-
- public function actionSet()
- {
- $server = new ListnewsServer();
- $state = $server->setList();
- return Help::JsonCode($state['code'], $state['msg']);
- }
-
- public function actionOnepushnews()
- {
- $list_id = Yii::$app->request->get('list_id');
- return $this->render('onepushnews',['list_id'=>$list_id]);
- }
-
- public function actionOnepushnewsform()
- {
- $server = new ListnewsServer();
- $state = $server->getListNews();
- return Help::JsonData(0, $state['msg'], $state['count'], $state['data']);
- }
-
- public function actionOnepushnewsadd()
- {
- $list_id = Yii::$app->request->get('list_id');
- return $this->render('onepushnewsadd',['list_id'=>$list_id]);
- }
-
- public function actionOnepushnewsaddform()
- {
- $server = new ListnewsServer();
-
- $state = $server->varcherListInfo();
- if ($state['code'] == 200) {
- $state = $server->addListNews();
- }
- return Help::JsonCode($state['code'], $state['msg']);
- }
- }
|