LiveSetting.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * 商品管理
  4. */
  5. namespace app\admin\controller;
  6. use think\facade\View;
  7. use think\facade\Lang;
  8. /**
  9. * DSKMS多用户商城
  10. *
  11. * ----------------------------------------------------------------------------
  12. *
  13. * 控制器
  14. */
  15. class LiveSetting extends AdminControl
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize();
  20. Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/live_setting.lang.php');
  21. }
  22. public function index()
  23. {
  24. $config_model = model('config');
  25. if (!request()->isPost()) {
  26. $list_config = rkcache('config', true);
  27. View::assign('list_config', $list_config);
  28. $this->setAdminCurItem('index');
  29. return View::fetch();
  30. } else {
  31. $update_array = array();
  32. $update_array['live_type'] = input('post.live_type');
  33. $update_array['vod_tencent_play_key'] = input('post.vod_tencent_play_key');
  34. $update_array['vod_tencent_appid'] = input('post.vod_tencent_appid');
  35. $update_array['vod_tencent_play_domain'] = input('post.vod_tencent_play_domain');
  36. $update_array['vod_tencent_secret_id'] = input('post.vod_tencent_secret_id');
  37. $update_array['vod_tencent_secret_key'] = input('post.vod_tencent_secret_key');
  38. $update_array['live_push_domain'] = input('param.live_push_domain');
  39. $update_array['live_push_key'] = input('param.live_push_key');
  40. $update_array['live_play_domain'] = input('param.live_play_domain');
  41. $update_array['video_type'] = input('param.video_type');
  42. $update_array['aliyun_user_id'] = input('param.aliyun_user_id');
  43. $update_array['aliyun_access_key_id'] = input('param.aliyun_access_key_id');
  44. $update_array['aliyun_access_key_secret'] = input('param.aliyun_access_key_secret');
  45. $update_array['aliyun_live_push_domain'] = input('post.aliyun_live_push_domain');
  46. $update_array['aliyun_live_push_key'] = input('post.aliyun_live_push_key');
  47. $update_array['aliyun_live_play_domain'] = input('post.aliyun_live_play_domain');
  48. $update_array['aliyun_live_play_key'] = input('post.aliyun_live_play_key');
  49. $result = $config_model->editConfig($update_array);
  50. if ($result) {
  51. dkcache('config');
  52. $this->log(lang('ds_edit') . lang('live_setting'), 1);
  53. $this->success(lang('ds_common_save_succ'));
  54. } else {
  55. $this->log(lang('ds_edit') . lang('live_setting'), 0);
  56. }
  57. }
  58. }
  59. /**
  60. * 获取卖家栏目列表,针对控制器下的栏目
  61. */
  62. protected function getAdminItemList()
  63. {
  64. $menu_array = array(
  65. array(
  66. 'name' => 'index',
  67. 'text' => lang('ds_setting'),
  68. 'url' => url('live_setting/index')
  69. ),
  70. );
  71. return $menu_array;
  72. }
  73. }