...
|
...
|
@@ -37,18 +37,24 @@ class Home extends Base { |
|
|
|
|
|
$folder_ids = app()->request('folder_ids',[],['intval','abs']);
|
|
|
|
|
|
if(!is_array($folder_ids)){
|
|
|
app()->_json([]);
|
|
|
}
|
|
|
|
|
|
$where = ['email_id' => $this->getEmail('id')];
|
|
|
|
|
|
// 默认查询 inbox
|
|
|
if(!is_array($folder_ids)){
|
|
|
$folder_ids = db()->value(
|
|
|
sprintf(
|
|
|
"select `id` from `%s` where `email_id` = %d and `origin_folder` = 'INBOX'",
|
|
|
folderSql::$table
|
|
|
,$where['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"
|
|
|
"select `id`,`subject`,`seen`,`udate` from `%s` where `id` > %d %s order by `id` asc limit %d"
|
|
|
,listsSql::$table
|
|
|
,$last_id
|
|
|
,dbWhere($where)
|
...
|
...
|
|