go-admin icon indicating copy to clipboard operation
go-admin copied to clipboard

[BUG]对表进行筛选后,无法进行排序

Open sirizhou opened this issue 4 years ago • 1 comments

bug 描述 [详细地描述 bug,让大家都能理解]

使用admin插件生成了数据库curd程序。对其中的数值进行筛选,筛选后进行排序,出现错误 Ubuntu20PW2015-2021-11-18-11-34-02 Ubuntu20PW2015-2021-11-18-11-34-19

复现步骤 [清晰描述复现步骤,让别人也能看到问题]

image (十分抱歉我虚拟机没法上网)

期望结果 [描述你原本期望看到的结果]

可对筛选后的结果进行排序

复现代码 [提供可复现的代码,仓库,或线上示例]

salaryPanel := info.AddField("通道编号", "emp_no",db.Int).FieldSortable()
salaryPanel.FieldFilterable(types.FilterType{FormType: form.NumberRange})

版本信息:

  • GoAdmin 版本:1.2.23
  • golang 版本:
  • 浏览器环境:
  • 开发环境:

其他信息 [如截图等其他信息可以贴在这里]

sirizhou avatar Nov 18 '21 03:11 sirizhou

After filtering the table, it cannot be sorted image

image

Reproduction steps [clearly describe the reproduction steps so that others can see the problem] image

Expected result [Describe what you originally expected] Sort the filtered results

Reproducible code [Provide reproducible code, warehouse, or online example] info.AddSelectBox("Type selection", types.FieldOptions{ {Value: "Title", Text: "Subdirectory"}, {Value: "Directory", Text: "Directory"}, }, action.FieldFilter("type")) info.SetTable("1_manage_help").SetTitle("Help Information Management")

Version Information: GoAdmin version: 1.2.23

Solution Remove the number prefix table name

image The same problem but the method to reproduce is different. This should be a problem. Although the problem can be solved by removing the number prefix of the table name, it should be allowed for the table name to start with a number.

If I am wrong, please contact me, thank you very much.

group-monkey avatar Dec 03 '21 08:12 group-monkey