Goodsvideo.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /*
  3. * 空间管理
  4. */
  5. namespace app\admin\controller;
  6. use think\facade\View;
  7. use think\facade\Lang;
  8. /**
  9. * ============================================================================
  10. *
  11. * ============================================================================
  12. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  13. * 网站地址: https://www.valimart.net/
  14. * ----------------------------------------------------------------------------
  15. *
  16. * ============================================================================
  17. * 控制器
  18. */
  19. class Goodsvideo extends AdminControl {
  20. public function initialize() {
  21. parent::initialize();
  22. Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/goodsvideo.lang.php');
  23. }
  24. /**
  25. * 视频列表
  26. */
  27. public function index() {
  28. $goods_model=model('goods');
  29. $video_list=$goods_model->getGoodsVideoList(array(),'*','goodsvideo_id desc',0,16);
  30. foreach($video_list as $key => $val){
  31. $video_list[$key]['goodsvideo_url']=goods_video($val['goodsvideo_name']);
  32. }
  33. View::assign('video_list', $video_list);
  34. View::assign('show_page', $goods_model->page_info->render());
  35. $this->setAdminCurItem('index');
  36. return View::fetch();
  37. }
  38. /**
  39. * 删除视频
  40. *
  41. */
  42. public function del_video() {
  43. $goodsvideo_id = input('param.goodsvideo_id');
  44. $goodsvideo_id_array = ds_delete_param($goodsvideo_id);
  45. if ($goodsvideo_id_array === FALSE) {
  46. ds_json_encode('10001', lang('param_error'));
  47. }
  48. $condition=array();
  49. $condition[]=array('goodsvideo_id','in',$goodsvideo_id_array);
  50. $goods_model = model('goods');
  51. //批量删除视频
  52. $goods_model->delGoodsVideo($condition);
  53. $this->log(lang('ds_del') . lang('goodsvideo') . '[ID:' . $goodsvideo_id . ']', 1);
  54. ds_json_encode('10000', lang('ds_common_op_succ'));
  55. }
  56. protected function getAdminItemList() {
  57. $menu_array = array(
  58. array(
  59. 'name' => 'index',
  60. 'text' => lang('ds_list'),
  61. 'url' => (string)url('Goodsvideo/index')
  62. )
  63. );
  64. return $menu_array;
  65. }
  66. }
  67. ?>