...
|
...
|
@@ -13,6 +13,7 @@ use Model\listsSql; |
|
|
use Model\sendJobsSql;
|
|
|
use PHPMailer\PHPMailer\PHPMailer;
|
|
|
use PHPMailer\PHPMailer\SMTP;
|
|
|
use function Swoole\Coroutine\Http\request;
|
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -64,7 +65,11 @@ class Home extends Base { |
|
|
// 文件夹id
|
|
|
if($folderList){
|
|
|
foreach ($folderList as $item){
|
|
|
if($item['folder'] == $folder){
|
|
|
if(
|
|
|
// 数组文件夹
|
|
|
(is_array($folder) && in_array($item['folder'],$folder))
|
|
|
|| $item['folder'] == $folder
|
|
|
){
|
|
|
$folder_id[] = $item['id'];
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -76,12 +81,56 @@ class Home extends Base { |
|
|
//目录
|
|
|
$where['folder_id'] = $folder_id;
|
|
|
if($ids) $where['id'] = $ids;
|
|
|
if($attachment) $where['is_file'] = 1; //附件
|
|
|
|
|
|
if(paramHas('attachment')){
|
|
|
$where['is_file'] = $attachment ? 1 : 0; //附件
|
|
|
}
|
|
|
|
|
|
|
|
|
// 软删
|
|
|
$where['deleted'] = $deleted;
|
|
|
// 已读/未读
|
|
|
if(in_array($seen,[0,1])){
|
|
|
$where['seen'] = $seen;
|
|
|
if(paramHas('seen')){
|
|
|
if(in_array($seen,[0,1])){
|
|
|
$where['seen'] = $seen;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$where['_'] = [];
|
|
|
// 搜索关键字
|
|
|
$keyword = app()->request('keyword','',['htmlspecialchars','addslashes']);
|
|
|
if($keyword){
|
|
|
$where['_'][] = '`subject` like "%'.$keyword.'%"';
|
|
|
}
|
|
|
|
|
|
// 那个发的
|
|
|
$address = app()->request('address');
|
|
|
if($address){
|
|
|
if(is_array($address)){
|
|
|
// 发贱人
|
|
|
if(Verify::sEmail($address['from']??'')){
|
|
|
$where['from'] = $address['from'];
|
|
|
}
|
|
|
// 收件人
|
|
|
if(Verify::sEmail($address['to']??'')){
|
|
|
$where['_'][] = '`to_name` like "%'.$address.'%"';
|
|
|
}
|
|
|
|
|
|
}else if(Verify::sEmail($address)){
|
|
|
// 收件人/发件人
|
|
|
$where['_'][] = '(`from` = "'.$address.'" or `to_name` like "%'.$address.'%")';
|
|
|
}
|
|
|
}
|
|
|
// 回复
|
|
|
if (paramHas('answered')){
|
|
|
$where['answered'] = app()->request('answered',0,'bool_Val')?1:0;
|
|
|
}
|
|
|
|
|
|
$fromto = app()->request('formorto');
|
|
|
if($fromto=='from'){
|
|
|
$where['from'] = $this->getEmails('email');
|
|
|
}elseif ($fromto=='to'){
|
|
|
$where['from.notin'] = $this->getEmails('email');
|
|
|
}
|
|
|
|
|
|
$lists = db()->all(
|
...
|
...
|
|