正在显示
2 个修改的文件
包含
82 行增加
和
0 行删除
controller/v2/Home.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace Controller\v2; | ||
4 | + | ||
5 | +use Controller\Base; | ||
6 | +use Lib\Mail\Mail; | ||
7 | +use Lib\Mail\MailFun; | ||
8 | +use Lib\UploadFile; | ||
9 | +use Lib\Verify; | ||
10 | +use Model\bodySql; | ||
11 | +use Model\emailSql; | ||
12 | +use Model\folderSql; | ||
13 | +use Model\listsSql; | ||
14 | +use Model\sendJobsSql; | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | +/** | ||
19 | + * @author:dc | ||
20 | + * @time 2023/2/13 11:28 | ||
21 | + * Class Home | ||
22 | + * @package Controller | ||
23 | + */ | ||
24 | +class Home extends Base { | ||
25 | + | ||
26 | + | ||
27 | + /** | ||
28 | + * 邮件列表 针对aicc应用那边 | ||
29 | + * @author:dc | ||
30 | + * @time 2023/2/17 14:12 | ||
31 | + */ | ||
32 | + public function lists(){ | ||
33 | + | ||
34 | + $limit = app()->request('limit',20,['intval','abs']); | ||
35 | + | ||
36 | + $last_id = app()->request('last_id',0,['intval','abs']); | ||
37 | + | ||
38 | + $email_id = app()->request('email_id',0,['intval','abs']); | ||
39 | + | ||
40 | + $folder_ids = app()->request('folder_ids',[],['intval','abs']); | ||
41 | + | ||
42 | + if(!is_array($folder_ids)){ | ||
43 | + app()->_json([]); | ||
44 | + } | ||
45 | + | ||
46 | + $where = ['email_id' => $email_id]; | ||
47 | + | ||
48 | + //目录 | ||
49 | + $where['folder_id'] = $folder_ids; | ||
50 | + | ||
51 | + $lists = db()->all( | ||
52 | + sprintf( | ||
53 | + "select `id`,`subject` from `%s` where `id` > %d %s order by `id` asc limit %d" | ||
54 | + ,listsSql::$table | ||
55 | + ,$last_id | ||
56 | + ,dbWhere($where) | ||
57 | + ,$limit | ||
58 | + ) | ||
59 | + ); | ||
60 | + | ||
61 | + app()->_json($lists); | ||
62 | + | ||
63 | + } | ||
64 | + | ||
65 | + | ||
66 | +} | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + |
@@ -12,6 +12,8 @@ return [ | @@ -12,6 +12,8 @@ return [ | ||
12 | 'login' => [\Controller\Login::class, 'login'], | 12 | 'login' => [\Controller\Login::class, 'login'], |
13 | // 邮件列表 | 13 | // 邮件列表 |
14 | 'lists' => [\Controller\Home::class, 'lists'], | 14 | 'lists' => [\Controller\Home::class, 'lists'], |
15 | + // 这个是单独处理的 aicc那边的应用 | ||
16 | + 'v2/lists' => [\Controller\v2\Home::class, 'lists'], | ||
15 | // 邮件详情 | 17 | // 邮件详情 |
16 | 'info' => [\Controller\Home::class, 'info'], | 18 | 'info' => [\Controller\Home::class, 'info'], |
17 | // 邮件文件夹 | 19 | // 邮件文件夹 |
-
请 注册 或 登录 后发表评论