From 9af312cceae783c3ca16187487bb36213cbf4dcf Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 13 Sep 2026 11:03:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E6=88=91=E7=9A=84=E4=BB=A3=E9=87=91?= =?UTF-8?q?=E5=88=B8=E7=8A=B6=E6=80=81/=E6=9D=A5=E6=BA=90=E5=88=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=AD=E6=96=87=E2=80=94=E2=80=94code?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=8F=96user=5Fdata[textField],API=E8=A1=A5s?= =?UTF-8?q?tatus=5Ftext/source=5Ftext=20LEFT=20JOIN=20appcodes=5Fkv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- voucher/init.py | 5 ++++- wwwroot/my/index.ui | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/voucher/init.py b/voucher/init.py index 9d1df3d..6e637d2 100644 --- a/voucher/init.py +++ b/voucher/init.py @@ -125,9 +125,12 @@ async def my_vouchers_api(request, params_kw): ns['st'] = status sql = ("SELECT a.id, a.code, a.status, a.face_value, a.actual_deducted, " "a.valid_from, a.valid_to, a.issued_at, a.used_at, a.source, a.remark, " - "b.name as template_name " + "b.name as template_name, " + "c.v as status_text, d.v as source_text " "FROM voucher_instance a " "LEFT JOIN voucher_template b ON a.template_id=b.id " + "LEFT JOIN appcodes_kv c ON c.k=a.status AND c.parentid='voucher_instance_status' " + "LEFT JOIN appcodes_kv d ON d.k=a.source AND d.parentid='vchr_source' " + where + " ORDER BY a.issued_at DESC") recs = await sor.sqlExe(sql, ns) rows = [_jsonable_instance(dict(r)) for r in (recs or [])] diff --git a/wwwroot/my/index.ui b/wwwroot/my/index.ui index 6582743..381929d 100644 --- a/wwwroot/my/index.ui +++ b/wwwroot/my/index.ui @@ -36,10 +36,10 @@ "browserfields": { "exclouded": ["id"], "alters": { - "status": {"uitype": "code", "data": [ + "status": {"uitype": "code", "textField": "status_text", "data": [ {"value": "unused", "text": "未使用"}, {"value": "used", "text": "已使用"}, {"value": "expired", "text": "已过期"}, {"value": "void", "text": "已作废"}]}, - "source": {"uitype": "code", "data": [ + "source": {"uitype": "code", "textField": "source_text", "data": [ {"value": "manual", "text": "手动发放"}, {"value": "register", "text": "注册赠券"}, {"value": "promo", "text": "促销活动"}]} }