12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace backend\controllers;
- use backend\base\CommonController;
- use backend\server\Listclassnevserver;
- use backend\base\Help;
- use Yii;
- class ListclassnevController extends CommonController
- {
-
- 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;
- $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,'操作失败');
- }
- }
|