1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- /**
- * Created by PhpStorm.
- * User: LYY
- * Date: 2020/10/21
- * Time: 15:01
- */
- 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']);
- }
- }
|