moshaorui 1 month ago
parent
commit
7e5e3eb6db
2 changed files with 17 additions and 0 deletions
  1. 12 0
      app/Admin/Controllers/SiteAlbumController.php
  2. 5 0
      config/dictionary.php

+ 12 - 0
app/Admin/Controllers/SiteAlbumController.php

@@ -177,7 +177,19 @@ JS
                 $filter->expand();
                 $filter->like('model')->width(2);
                 $filter->equal('folder_id',admin_trans_label('folder'))->select($selectOptions)->width(3);
+                $filter->where('status', function ($query) {
+                    $status = $this->input;
+                    // 自定义查询逻辑
+                    if ($status == 1) {
+                        // 三个月内的
+                        $query->where('updated_at', '>=', date('Y-m-d H:i:s', strtotime('-3 month')));
+                    } else {
+                        // 三个月前的
+                        $query->where('updated_at', '<', date('Y-m-d H:i:s', strtotime('-3 month')));
+                    }
+                })->select(admin_trans_array(config('dictionary.album_status')))->width(3);
             });
+
             $grid->disableViewButton();
             $grid->disablePerPages();
             $grid->disableRefreshButton();

+ 5 - 0
config/dictionary.php

@@ -37,5 +37,10 @@ return [
     ],
 
 
+    'album_status' => [
+        '0' => '待更新', //用于用于相册文件夹的临时变量
+        '1' => '正常',
+    ],
+
 
 ];