作者 邓超

home

... ... @@ -176,10 +176,10 @@ class Home extends Base {
if($form_not_in){
$form_not_in = is_array($form_not_in) ? $form_not_in : [$form_not_in];
$form_not_in = array_filter($form_not_in,function ($v){
if(is_string($v) && Verify::sEmail($v)){
return true;
}
return false;
if(is_string($v) && Verify::sEmail($v)){
return true;
}
return false;
});
if($form_not_in){
if(isset($where['from.notin'])){
... ... @@ -234,6 +234,40 @@ class Home extends Base {
}
/**
* 统计
* @throws \Lib\Err
* @author:dc
* @time 2024/10/14 16:20
*/
public function count()
{
$where = [];
$where['folder_id'] = [];
// 目录
$folder = app()->request('folder', '收件箱');
$folderList = db()->all(folderSql::all($where['email_id']));
// 文件夹id
if ($folderList) {
foreach ($folderList as $item) {
if ($item['folder'] == $folder) {
$where['folder_id'][] = $item['id'];
}
}
}
// 软删
$where['deleted'] = 0;
// 总数
$total = db()->count(listsSql::listCount(dbWhere($where)));
app()->_json(['total'=>$total]);
}
/**
* 检测邮箱状态
... ... @@ -403,10 +437,10 @@ class Home extends Base {
// 保存
$draftid = listsSql::saveDraft($sendData,$email,app()->request('draft_id',0,'intval'));
// 保存失败
if($draftid){
if($draftid){
app()->_json(['draft_id'=>$draftid]);
}
app()->e('save_draft_error');
}
app()->e('save_draft_error');
}
// 定时发送 或者是单条发送
... ... @@ -554,7 +588,7 @@ class Home extends Base {
// return $mailInstance->move($uid,$origin_folder,$to_origin_folder);
// }catch (\Throwable $e){
// if(app()->request('move_err_copy',1)){
// 复制成功
// 复制成功
try {
if($mailInstance->copy($uid,$origin_folder,$to_origin_folder)){
return $mailInstance->deleted($uid,$origin_folder);
... ... @@ -859,7 +893,7 @@ class Home extends Base {
// 是否再次 重新获取
$reload = app()->request('reload',0,'intval');
$data['allowreply'] = db()->value(folderSql::first(['id'=>$data['folder_id']],'folder'))!='发件箱'?1:0;
HOME_INFO_BODY:
$body = db()->first(bodySql::first($id));
if($body && !$reload){
... ...