作者 邓超

x

... ... @@ -58,10 +58,15 @@ class Home extends Base {
$where = ['email_id'=>$this->getEmails('id')];
$folder_id = [];
if (app()->requestArr('folder_id')){
$folder_id = app()->requestArr('folder_id');
}else{
// 目录
$folder = app()->request('folder','收件箱');
$folderList = db()->all(folderSql::all($where['email_id']));
$folder_id = [];
// 文件夹id
if($folderList){
foreach ($folderList as $item){
... ... @@ -74,8 +79,6 @@ class Home extends Base {
}
}
}
if (app()->requestArr('folder_id')){
$folder_id = array_merge($folder_id,app()->requestArr('folder_id'));
}
if(!$folder_id){
... ...
... ... @@ -45,7 +45,7 @@ class folderSql {
*/
public static function first(array|string|int $where,$filed = '*'):string {
$where = is_numeric($where) ? ['id'=>$where] : $where;
return "select {$filed} from `".self::$table."` where ".dbWhere($where)." order by `id` desc limit 1";
return "select {$filed} from `".self::$table."` where ".dbWhere($where)." limit 1";
}
/**
... ... @@ -57,7 +57,7 @@ class folderSql {
* @time 2023/5/8 11:01
*/
public static function originFolder(int $email_id,string $folder){
return "select `origin_folder` from `".static::$table."` where `email_id` = {$email_id} and `folder` = '{$folder}' order by `id` desc limit 1";
return "select `origin_folder` from `".static::$table."` where `email_id` = {$email_id} and `folder` = '{$folder}' limit 1";
}
}
... ...