作者 邓超

x

@@ -58,10 +58,15 @@ class Home extends Base { @@ -58,10 +58,15 @@ class Home extends Base {
58 58
59 $where = ['email_id'=>$this->getEmails('id')]; 59 $where = ['email_id'=>$this->getEmails('id')];
60 60
  61 +
  62 + $folder_id = [];
  63 + if (app()->requestArr('folder_id')){
  64 + $folder_id = app()->requestArr('folder_id');
  65 + }else{
61 // 目录 66 // 目录
62 $folder = app()->request('folder','收件箱'); 67 $folder = app()->request('folder','收件箱');
63 $folderList = db()->all(folderSql::all($where['email_id'])); 68 $folderList = db()->all(folderSql::all($where['email_id']));
64 - $folder_id = []; 69 +
65 // 文件夹id 70 // 文件夹id
66 if($folderList){ 71 if($folderList){
67 foreach ($folderList as $item){ 72 foreach ($folderList as $item){
@@ -74,8 +79,6 @@ class Home extends Base { @@ -74,8 +79,6 @@ class Home extends Base {
74 } 79 }
75 } 80 }
76 } 81 }
77 - if (app()->requestArr('folder_id')){  
78 - $folder_id = array_merge($folder_id,app()->requestArr('folder_id'));  
79 } 82 }
80 83
81 if(!$folder_id){ 84 if(!$folder_id){
@@ -45,7 +45,7 @@ class folderSql { @@ -45,7 +45,7 @@ class folderSql {
45 */ 45 */
46 public static function first(array|string|int $where,$filed = '*'):string { 46 public static function first(array|string|int $where,$filed = '*'):string {
47 $where = is_numeric($where) ? ['id'=>$where] : $where; 47 $where = is_numeric($where) ? ['id'=>$where] : $where;
48 - return "select {$filed} from `".self::$table."` where ".dbWhere($where)." order by `id` desc limit 1"; 48 + return "select {$filed} from `".self::$table."` where ".dbWhere($where)." limit 1";
49 } 49 }
50 50
51 /** 51 /**
@@ -57,7 +57,7 @@ class folderSql { @@ -57,7 +57,7 @@ class folderSql {
57 * @time 2023/5/8 11:01 57 * @time 2023/5/8 11:01
58 */ 58 */
59 public static function originFolder(int $email_id,string $folder){ 59 public static function originFolder(int $email_id,string $folder){
60 - return "select `origin_folder` from `".static::$table."` where `email_id` = {$email_id} and `folder` = '{$folder}' order by `id` desc limit 1"; 60 + return "select `origin_folder` from `".static::$table."` where `email_id` = {$email_id} and `folder` = '{$folder}' limit 1";
61 } 61 }
62 62
63 } 63 }