tonghuaAction.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * 音视频通话使用的
  4. */
  5. class tonghuaClassAction extends Action{
  6. public function defaultAction()
  7. {
  8. $id = (int)$this->get('id','0');
  9. $channel = $this->get('channel');
  10. $iscall = 'true';
  11. if($channel){
  12. $thrs = m('im_tonghua')->getone("`channel`='$channel'");
  13. if(!$thrs)return '无效记录';
  14. $state= $thrs['state'];
  15. if($state==3 || $state==5)return '通话已取消';
  16. if($state!='0')return '通话记录无效';
  17. if($thrs['faid']!=$id)return '无效打开';
  18. if($thrs['joinids']!=$this->adminid)return '不是跟你的通话';
  19. $iscall = 'false';
  20. $sytime = time()-strtotime($thrs['adddt']);
  21. $thrs['sytime'] = $sytime;
  22. $this->assign('thrs', $thrs);
  23. }else{
  24. $thrs['sytime'] = 0;
  25. $thrs['channel'] = '';
  26. $thrs['type'] = 0;
  27. $this->assign('thrs', $thrs);
  28. }
  29. $dbs= m('admin');
  30. $ars= $dbs->getone('`id`='.$id.' and `status`=1','id,name,face');
  31. if(!$ars)return '用户不存在';
  32. $this->title = '与'.$ars['name'].'通话';
  33. $ars['face'] = $dbs->getface($ars['face']);
  34. $ars['iscall'] = $iscall;
  35. $this->assign('ars', $ars);
  36. }
  37. }
粤ICP备19079148号