Setting.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace app\shop\controller\plus\live;
  3. use app\shop\controller\Controller;
  4. use app\shop\model\settings\Setting as SettingModel;
  5. /**
  6. * 直播设置
  7. */
  8. class Setting extends Controller
  9. {
  10. /**
  11. *获取直播设置
  12. */
  13. public function getSetting()
  14. {
  15. $vars['values'] = SettingModel::getItem('live');
  16. // 声网录制存储
  17. $storage = $this->getStorage();
  18. return $this->renderSuccess('', compact('vars', 'storage'));
  19. }
  20. /**
  21. * 直播设置
  22. */
  23. public function index()
  24. {
  25. if($this->request->isGet()){
  26. return $this->getSetting();
  27. }
  28. $model = new SettingModel;
  29. $data = $this->request->param();
  30. if ($model->edit('live', $data)) {
  31. return $this->renderSuccess('操作成功');
  32. }
  33. return $this->renderError('操作失败');
  34. }
  35. /**
  36. * 声网录制存储
  37. */
  38. private function getStorage(){
  39. $storage = [
  40. 'qiniu' => [
  41. 'vendor' => '0',
  42. 'name' => '七牛云',
  43. 'region' => [
  44. '华东' => '0',
  45. '华北' => '1',
  46. '华南' => '2',
  47. '北美' => '3',
  48. '东南亚' => '4',
  49. ]
  50. ],
  51. 'aliyun' => [
  52. 'vendor' => '2',
  53. 'name' => '阿里云',
  54. 'region' => [
  55. '杭州' => '0',
  56. '上海' => '1',
  57. '青岛' => '2',
  58. '北京' => '3',
  59. '张家界' => '4',
  60. '呼和浩特' => '5',
  61. '深圳' => '6',
  62. '香港' => '7',
  63. ]
  64. ],
  65. 'qcloud' => [
  66. 'vendor' => '3',
  67. 'name' => '腾讯云',
  68. 'region' => [
  69. '北京' => '1',
  70. '上海' => '2',
  71. '广州' => '3',
  72. '成都' => '4',
  73. '重庆' => '5',
  74. '深圳金融' => '6',
  75. '上海金融' => '7',
  76. '北京金融' => '8',
  77. '香港' => '9',
  78. ]
  79. ]
  80. ];
  81. return $storage;
  82. }
  83. }