VrController.php 919 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/8
  6. * Time: 上午10:33
  7. */
  8. namespace backend\controllers;
  9. use backend\base\CommonController;
  10. use backend\base\Help;
  11. use backend\server\Vrserver;
  12. use Yii;
  13. class VrController extends CommonController
  14. {
  15. public function actionVrindex()
  16. {
  17. $type = Yii::$app->request->get('type');
  18. return $this->render('vrindex', ['type' => $type]);
  19. }
  20. //获取VR新版列表数据
  21. public function actionVrindexform()
  22. {
  23. $server = new Vrserver();
  24. $data = $server->getList();
  25. return Help::JsonData(0, '成功', $data['count'], $data['data']);
  26. }
  27. public function actionVrset()
  28. {
  29. $server = new Vrserver();
  30. $state = $server->vrSet();
  31. if ($state === true) return Help::JsonCode(Help::SUCCESS, '执行成功');
  32. return Help::JsonCode(Help::ERROR, '执行失败');
  33. }
  34. }