12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- /**
- * Created by PhpStorm.
- * User: 201901
- * Date: 2020/3/3
- * Time: 15:01
- */
- namespace backend\controllers;
- use backend\base\CommonController;
- use backend\server\Listclassnevserver;
- use backend\base\Help;
- use Yii;
- class ListclassnevController extends CommonController
- {
- /*
- * 2020.9.9 lyy 近日头条
- * */
- public function actionDaytoutiao()
- {
- return $this->render('daytoutiaoindex');
- }
- /*
- * 近日头条栏目添加页面
- * */
- public function actionDaytoutiaoadd()
- {
- return $this->render('daytoutiaoadd');
- }
- /*
- * 近日头条栏目修改页面
- * */
- public function actionDaytoutiaoedit()
- {
- $id = Yii::$app->request->get('id');
- $server = new Listclassnevserver();
- $data = $server->getFindOne($id);
- return $this->render('daytoutiaoedit',['data'=>$data]);
- }
- public function actionDaytoutiaoform()
- {
- $input = Yii::$app->request->post();
- $input['type'] = 1; //近日头条栏目类别 1 ;
- $server = new Listclassnevserver();
- $data = $server->getClassNevData($input);
- if ($data === false) return Help::JsonCode(Help::ERROR, '参数有误,请联系管理员咨询');
- return Help::JsonData(0, '获取成功', $data['count'], $data['data']);
- }
- public function actionDaytoutiaoaddform()
- {
- $input = Yii::$app->request->post();
- $input['type'] = 1;
- $server = new Listclassnevserver();
- $data = $server->addDayToutiao($input);
- if ($data) return Help::JsonCode(Help::SUCCESS, '添加成功');
- return Help::JsonCode(Help::ERROR, '添加失败');
- }
- public function actionDaytoutiaoeditform()
- {
- $input = Yii::$app->request->post();
- $server = new Listclassnevserver();
- $data = $server->editDayToutiao($input);
- if ($data) return Help::JsonCode(Help::SUCCESS, '编辑成功');
- return Help::JsonCode(Help::ERROR, '编辑失败');
- }
- public function actionDaytoutiaoset()
- {
- $input = Yii::$app->request->post();
- $server = new Listclassnevserver();
- $data = $server->setDayToutiao($input);
- if($data) return Help::JsonCode(Help::SUCCESS,'操作成功');
- return Help::JsonCode(Help::ERROR,'操作失败');
- }
- }
|