作者 邓超

1

... ... @@ -44,7 +44,7 @@ class Home extends Base {
}
// 附件
$attachment = app()->request('attachment');
$attachment = app()->request('attachment',0,'bool_Val');
// 已读/未读
$seen = app()->request('seen',-1,'intval');
// 软删
... ... @@ -375,13 +375,12 @@ class Home extends Base {
HOME_INFO_BODY:
// 循环几次
if($sync_num < 1){
$data['to_name'] = json_decode($data['to_name']??"[]",true);
$body = db()->first(bodySql::first($id));
if($body){
$data['body'] = json_decode($body['text_html'],true);
return [
'data' => [
'info' => $data,
'body' => json_decode($body['text_html'],true)
]
'data' => $data
];
}
... ...
... ... @@ -344,8 +344,28 @@ function folderAlias($folder){
}
/**
* true false
* @param $val
* @return bool
* @author:dc
* @time 2023/4/1 17:42
*/
function bool_Val($val):bool {
if($val == 'true'){
return true;
}
if($val == 'false'){
return false;
}
if(is_numeric($val)){
return intval($val) ? true : false;
}
return $val ? true : false;
}
... ...
... ... @@ -585,9 +585,15 @@ class Imap {
}
$result[$key]['HEADER.FIELDS']['Subject'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['Subject'],$charset);
$result[$key]['HEADER.FIELDS']['From'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['From'],$charset);
$result[$key]['HEADER.FIELDS']['To'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['To'],$charset);
if(!empty($result[$key]['HEADER.FIELDS']['Subject'])){
$result[$key]['HEADER.FIELDS']['Subject'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['Subject'],$charset);
}
if(!empty($result[$key]['HEADER.FIELDS']['From'])){
$result[$key]['HEADER.FIELDS']['From'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['From'],$charset);
}
if(!empty($result[$key]['HEADER.FIELDS']['To'])){
$result[$key]['HEADER.FIELDS']['To'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['To'],$charset);
}
}
... ...
... ... @@ -256,15 +256,21 @@ class Mail {
foreach ($results as $insert){
if(empty($uuids[$insert['uuid']])){
// 新增
$id = $db->insert(listsSql::$table,$insert);
// 同步body内容
redis()->rPush('sync_email_body', [
'lists_id' => $id,
'email_id' => $email_id,
'folder_id' => $folder_id,
'folder' => $folder,
'uid' => $insert['uid'],
]);
try {
$id = $db->insert(listsSql::$table,$insert);
// 同步body内容
redis()->rPush('sync_email_body', [
'lists_id' => $id,
'email_id' => $email_id,
'folder_id' => $folder_id,
'folder' => $folder,
'uid' => $insert['uid'],
]);
}catch (\Throwable $e){
}
}else{
// 修改
$db->update(
... ...