fastadmin自定义列表下拉框筛选

JS代码:

{field: 'type.name', title: __('Type.name'), searchList: $.getJSON("ai/activity_type/source")},

PHP代码:

public function source()
{
        $json = cache('ai_activity_type');
        if ($json === false) {
            $typeModel = new \app\admin\model\ai\ActivityType();
            $list = $typeModel->field('name')->select();
            $json = json($list);
            cache('ai_activity_type', $json);
        }
        return $json;
}
        

 

posted @ 2022-06-21 16:18  U丶Zero  阅读(1230)  评论(0编辑  收藏  举报