| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- <?php
 
- // +—————————————————————————————————————————————————————————————————————
 
- // | Created by Yunbao
 
- // +—————————————————————————————————————————————————————————————————————
 
- // | Copyright (c) 2013~2022 http://www.yunbaokj.com All rights reserved.
 
- // +—————————————————————————————————————————————————————————————————————
 
- // | Author: https://gitee.com/yunbaokeji
 
- // +—————————————————————————————————————————————————————————————————————
 
- // | Date: 2022-02-17
 
- // +—————————————————————————————————————————————————————————————————————
 
- /**
 
-  * 直播记录
 
-  */
 
- namespace app\admin\controller;
 
- use cmf\controller\AdminBaseController;
 
- use think\Db;
 
- class LiverecordController extends AdminbaseController {
 
-     public function index(){
 
-         
 
-         $config=getConfigPub();
 
- 	
 
-         $data = $this->request->param();
 
-         $map=[];
 
-         
 
-         $start_time=isset($data['start_time']) ? $data['start_time']: '';
 
-         $end_time=isset($data['end_time']) ? $data['end_time']: '';
 
-         
 
-         if($start_time!=""){
 
-            $map[]=['starttime','>=',strtotime($start_time)];
 
-         }
 
-         if($end_time!=""){
 
-            $map[]=['starttime','<=',strtotime($end_time) + 60*60*24];
 
-         }
 
-         
 
-         $uid=isset($data['uid']) ? $data['uid']: '';
 
-         if($uid!=''){
 
-             $lianguid=getLianguser($uid);
 
-             if($lianguid){
 
-                 $map[]=['uid',['=',$uid],['in',$lianguid],'or'];
 
-             }else{
 
-                 $map[]=['uid','=',$uid];
 
-             }
 
-         }	
 
- 			
 
-     	$lists = Db::name("live_record")
 
-                 ->where($map)
 
-                 ->order("id DESC")
 
-                 ->paginate(20);
 
-                 
 
-         $lists->each(function($v,$k){
 
- 			$v['userinfo']=getUserInfo($v['uid']);
 
-             return $v;           
 
-         });
 
-                 
 
-         $lists->appends($data);
 
-         $page = $lists->render();
 
-     	$this->assign('lists', $lists);
 
-     	$this->assign("page", $page);
 
-     	$this->assign("config", $config);
 
-     	
 
-     	return $this->fetch();
 
-     }
 
-     
 
-     public function del()
 
-     {
 
-         $id = $this->request->param('id', 0, 'intval');
 
-         
 
-         $rs = DB::name('live_record')->where("id={$id}")->delete();
 
-         if(!$rs){
 
-             $this->error("删除失败!");
 
-         }
 
-         
 
-         $this->success("删除成功!",url("liverecord/index"));		
 
-     }
 
- 		
 
- }
 
 
  |