|
@@ -41,7 +41,7 @@ class Test extends Controller
|
|
|
// 'ChatType' => 'Group',
|
|
|
'ChatType' => 'C2C',
|
|
|
// 'MsgTime' => date('YmdH',strtotime('-1 Days')),
|
|
|
- 'MsgTime' => date('YmdH',strtotime('-1 Hours')),
|
|
|
+ 'MsgTime' => date('YmdH',strtotime('-3 Hours')),
|
|
|
];
|
|
|
$tasklog = [
|
|
|
'type' => $data['ChatType'] == 'C2C' ? 1 : 2,
|
|
@@ -157,7 +157,7 @@ class Test extends Controller
|
|
|
if(!empty($MsgList)){
|
|
|
foreach($MsgList as $key => $val)
|
|
|
{
|
|
|
- $newMsgList[] = [
|
|
|
+ $newone = [
|
|
|
'ClientIP' => $val['ClientIP'],
|
|
|
'CloudCustomData' => isset($val['CloudCustomData']) ? $val['CloudCustomData'] : '',
|
|
|
'From_Account' => intval($val['From_Account']),
|
|
@@ -168,6 +168,40 @@ class Test extends Controller
|
|
|
'MsgTimestamp' => $val['MsgTimestamp'],
|
|
|
'To_Account' => intval($val['To_Account']),
|
|
|
];
|
|
|
+ //解析数据类型
|
|
|
+ if(isset($val['MsgBody'][0]['MsgType'])){
|
|
|
+ $newone['MsgType'] = $val['MsgBody'][0]['MsgType'];
|
|
|
+ //文本
|
|
|
+ if($val['MsgBody'][0]['MsgType'] == 'TIMTextElem'){
|
|
|
+ $newone['MsgInfo'] = '';
|
|
|
+ if(isset($val['MsgBody'][0]['MsgContent']['Text'])){
|
|
|
+ $newone['MsgInfo'] = $val['MsgBody'][0]['MsgContent']['Text'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //图片
|
|
|
+ if($val['MsgBody'][0]['MsgType'] == 'TIMImageElem'){
|
|
|
+ $newone['MsgInfo'] = '';
|
|
|
+ if(isset($val['MsgBody'][0]['MsgContent']['ImageInfoArray'][0]['URL'])){
|
|
|
+ $newone['MsgInfo'] = $val['MsgBody'][0]['MsgContent']['ImageInfoArray'][0]['URL'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //声音
|
|
|
+ if($val['MsgBody'][0]['MsgType'] == 'TIMSoundElem'){
|
|
|
+ $newone['MsgInfo'] = '';
|
|
|
+ if(isset($val['MsgBody'][0]['MsgContent']['Url'])){
|
|
|
+ $newone['MsgInfo'] = $val['MsgBody'][0]['MsgContent']['Url'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //视频
|
|
|
+ if($val['MsgBody'][0]['MsgType'] == 'TIMVideoFileElem'){
|
|
|
+ $newone['MsgInfo'] = '';
|
|
|
+ if(isset($val['MsgBody'][0]['MsgContent']['VideoUrl'])){
|
|
|
+ $newone['MsgInfo'] = $val['MsgBody'][0]['MsgContent']['VideoUrl'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $newMsgList[] = $newone;
|
|
|
}
|
|
|
}
|
|
|
}
|