Home.php
990 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace Controller\v3;
use Controller\Base;
use Lib\Imap\ImapSearch;
use Lib\Mail\Mail;
use Lib\Mail\MailFun;
use Lib\UploadFile;
use Lib\Verify;
use Model\bodySql;
use Model\emailSql;
use Model\folderSql;
use Model\listsSql;
use Model\sendJobsSql;
use Service\SyncMail;
use function Co\run;
use function Swoole\Coroutine\Http\request;
/**
* @author:dc
* @time 2023/2/13 11:28
* Class Home
* @package Controller
*/
class Home extends Base {
/**
* v3 版本
* 同步邮件
* @return string
* @throws \Lib\Err
* @author:dc
* @time 2023/8/2 16:19
*/
public function sync(){
$id = app()->request('id');
if($id && is_numeric($id)){
ob_start();
$num = (new SyncMail($id))->search((new ImapSearch())->date(date('Y-m-d')))->sync();
ob_clean();
if(is_array($num)){
app()->_json($num);
}
}
return 'ok';
}
}