|
|
<?php
|
|
|
|
|
|
namespace Controller\v2;
|
|
|
|
|
|
use Controller\Base;
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @author:dc
|
|
|
* @time 2023/2/13 11:28
|
|
|
* Class Home
|
|
|
* @package Controller
|
|
|
*/
|
|
|
class Home extends Base {
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 邮件列表 针对aicc应用那边
|
|
|
* @author:dc
|
|
|
* @time 2023/2/17 14:12
|
|
|
*/
|
|
|
public function lists(){
|
|
|
|
|
|
$limit = app()->request('limit',20,['intval','abs']);
|
|
|
|
|
|
$last_id = app()->request('last_id',0,['intval','abs']);
|
|
|
|
|
|
$email_id = app()->request('email_id',0,['intval','abs']);
|
|
|
|
|
|
$folder_ids = app()->request('folder_ids',[],['intval','abs']);
|
|
|
|
|
|
if(!is_array($folder_ids)){
|
|
|
app()->_json([]);
|
|
|
}
|
|
|
|
|
|
$where = ['email_id' => $email_id];
|
|
|
|
|
|
//目录
|
|
|
$where['folder_id'] = $folder_ids;
|
|
|
|
|
|
$lists = db()->all(
|
|
|
sprintf(
|
|
|
"select `id`,`subject` from `%s` where `id` > %d %s order by `id` asc limit %d"
|
|
|
,listsSql::$table
|
|
|
,$last_id
|
|
|
,dbWhere($where)
|
|
|
,$limit
|
|
|
)
|
|
|
);
|
|
|
|
|
|
app()->_json($lists);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|