feat(admin): add role filter functionality- Implement role-based filtering for admin list

- Add sidebar with role options for filtering
- Update table to support 'find_in_set' operation for filtering-Enhance user experience by adding 'Reset' functionality
This commit is contained in:
wolfcode
2025-07-17 18:17:09 +08:00
parent 2d6e5aabbd
commit e12dead6c8
3 changed files with 52 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ use app\admin\traits\Curd;
use app\BaseController;
use app\common\constants\AdminConstant;
use app\common\traits\JumpTrait;
use think\facade\Db;
use think\facade\View;
use think\helper\Str;
use think\response\Json;
@@ -199,6 +200,9 @@ class AdminController extends BaseController
case 'in':
$where[] = [$key, 'IN', $val];
break;
case 'find_in_set':
$where[] = ['', 'exp', Db::raw("FIND_IN_SET(:param,$key)", ['param' => $val])];
break;
case 'range':
[$beginTime, $endTime] = explode(' - ', $val);
$where[] = [$key, '>=', strtotime($beginTime)];