作者 邓超

ai list

... ... @@ -5,6 +5,7 @@ namespace Controller\v2;
use Controller\Base;
use Lib\Imap\ImapSearch;
use Lib\Mail\Mail;
use Lib\Mail\MailFun;
use Model\folderSql;
use Model\listsSql;
use Service\SyncMail;
... ... @@ -96,6 +97,32 @@ class Home extends Base {
$lists = $lists['hits']['hits']??[];
$lists = array_map(function ($v){
$v = $v['_source'];
$v['id'] = $v['uuid'];
$v['from_name'] = $v['from']['name']??'';
$v['from'] = $v['from']['email']??'';
if(!empty($v['description'])){
$v['description'] = @html_entity_decode($v['description'], ENT_COMPAT, 'UTF-8');
}
$v['to_name'] = @json_decode($v['to_name'],true);
$v['to_name'] = $v['to_name']?:[];
if($v['to_name']){
if(!empty($v['to_name'][0]['email'])){
$v['to'] = $v['to_name'][0]['email'];
}
$v['to_name'] = MailFun::mb_coding($v['to_name'][0]['name']??'');
}
if(is_array($v['to_name'])){
$v['to_name'] = '';
}
return $v;
},$lists?:[]);
app()->_json(['data'=>$lists?:[]]);
}
... ...