|
@@ -65,19 +65,55 @@ class Imlogc2c extends Backend
|
|
$row->getRelation('touser')->visible(['nickname']);
|
|
$row->getRelation('touser')->visible(['nickname']);
|
|
}
|
|
}
|
|
|
|
|
|
- $result = array("total" => $list->total(), "rows" => $list->items());
|
|
|
|
|
|
+ $list2 = collection($list->items())->toArray();
|
|
|
|
+
|
|
|
|
+ $type_arr = $this->type_arr();
|
|
|
|
+ foreach($list2 as $key => &$val){
|
|
|
|
+ $val['MsgType'] = isset($type_arr[$val['MsgType']]) ? $type_arr[$val['MsgType']] : '其他';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $result = array("total" => $list->total(), "rows" => $list2);
|
|
|
|
|
|
return json($result);
|
|
return json($result);
|
|
}
|
|
}
|
|
return $this->view->fetch();
|
|
return $this->view->fetch();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private function type_arr(){
|
|
|
|
+ $type_arr = [
|
|
|
|
+ 'TIMTextElem' => '文本',
|
|
|
|
+ 'TIMImageElem' => '图片',
|
|
|
|
+ 'TIMSoundElem' => '声音',
|
|
|
|
+ 'TIMVideoFileElem' => '视频',
|
|
|
|
+ ];
|
|
|
|
+ return $type_arr;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 消息体
|
|
* 消息体
|
|
*/
|
|
*/
|
|
public function showbody(){
|
|
public function showbody(){
|
|
$id = input('id',0);
|
|
$id = input('id',0);
|
|
$info = Db::name('imlog_c2c')->where('id',$id)->find();
|
|
$info = Db::name('imlog_c2c')->where('id',$id)->find();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $type_arr = $this->type_arr();
|
|
|
|
+
|
|
|
|
+ $info['typetext'] = isset($type_arr[$info['MsgType']]) ? $type_arr[$info['MsgType']] : '其他';
|
|
|
|
+
|
|
|
|
+ if($info['MsgType'] == 'TIMTextElem'){
|
|
|
|
+ $info['MsgInfo'] = $info['MsgInfo'];
|
|
|
|
+ }
|
|
|
|
+ if($info['MsgType'] == 'TIMImageElem'){
|
|
|
|
+ $info['MsgInfo'] = '<img width="800" height="800" src="'.$info['MsgInfo'].'">';
|
|
|
|
+ }
|
|
|
|
+ if($info['MsgType'] == 'TIMSoundElem'){
|
|
|
|
+ $info['MsgInfo'] = '<audio controls><source src="'.$info['MsgInfo'].'"></audio>';
|
|
|
|
+ }
|
|
|
|
+ if($info['MsgType'] == 'TIMVideoFileElem'){
|
|
|
|
+ $info['MsgInfo'] = '<video width="800" height="800" controls preload src="'.$info['MsgInfo'].'"></video>';
|
|
|
|
+ }
|
|
|
|
+
|
|
$this->assign('info',$info);
|
|
$this->assign('info',$info);
|
|
|
|
|
|
return $this->view->fetch();
|
|
return $this->view->fetch();
|