feat(rock): 库存列表直接显示 0666 编号和完整提取码

本地序号和上游编号不是同一个,按 0666 上的编号就能对上库存和兑换记录。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-10-06 11:49:47 +08:00
co-authored by Cursor
parent 3741f5ae73
commit 0967ecc5db
2 changed files with 17 additions and 11 deletions
+2 -2
View File
@@ -751,8 +751,8 @@ func (s *RockService) ListTokens(ctx context.Context, page, pageSize int, status
} }
if strings.TrimSpace(search) != "" { if strings.TrimSpace(search) != "" {
term := "%" + strings.TrimSpace(search) + "%" term := "%" + strings.TrimSpace(search) + "%"
db = db.Where("assigned_order_no LIKE ? OR expected_uid LIKE ? OR actual_role_name LIKE ? OR actual_role_id LIKE ? OR redeem_code LIKE ? OR assigned_order_no IN (SELECT order_no FROM fulfillment_orders WHERE client_order_no LIKE ?)", db = db.Where("CAST(id AS TEXT) = ? OR upstream_token_id = ? OR upstream_token_id LIKE ? OR assigned_order_no LIKE ? OR expected_uid LIKE ? OR actual_role_name LIKE ? OR actual_role_id LIKE ? OR redeem_code LIKE ? OR assigned_order_no IN (SELECT order_no FROM fulfillment_orders WHERE client_order_no LIKE ?)",
term, term, term, term, term, term) strings.TrimSpace(search), strings.TrimSpace(search), term, term, term, term, term, term, term)
} }
var total int64 var total int64
+15 -9
View File
@@ -294,19 +294,25 @@ export default function PlatformRock() {
const columns: ColumnsType<RockTokenItem> = [ const columns: ColumnsType<RockTokenItem> = [
{ {
title: 'ID / 提取码', title: '0666 编号 / 提取码',
dataIndex: 'id', dataIndex: 'upstream_token_id',
width: 170, width: 250,
render: (id, record) => ( render: (_, record) => (
<Space direction="vertical" size={2}> <Space direction="vertical" size={2}>
<Text code style={{ fontWeight: 600 }}>#{id}</Text>
<Text <Text
copyable={{ text: record.redeem_code }} copyable={record.upstream_token_id ? { text: record.upstream_token_id } : false}
style={{ fontWeight: 600 }}
>
0666 #{record.upstream_token_id || '-'}
</Text>
<Text
copyable={record.redeem_code ? { text: record.redeem_code } : false}
type="secondary" type="secondary"
style={{ fontSize: 12, fontFamily: 'monospace' }} style={{ fontSize: 12, fontFamily: 'monospace' }}
> >
{record.redeem_code ? `${record.redeem_code.substring(0, 10)}...` : '-'} {record.redeem_code || '-'}
</Text> </Text>
<Text type="secondary" style={{ fontSize: 11 }}>本地 #{record.id}</Text>
</Space> </Space>
), ),
}, },
@@ -933,12 +939,12 @@ export default function PlatformRock() {
<Col xs={24} md={16}> <Col xs={24} md={16}>
<Space size="middle" wrap> <Space size="middle" wrap>
<Input <Input
placeholder="搜索订单号 / UID / 角色名 / 提取码" placeholder="搜索 0666 编号 / 提取码 / 订单号 / UID"
prefix={<SearchOutlined style={{ color: '#94a3b8' }} />} prefix={<SearchOutlined style={{ color: '#94a3b8' }} />}
value={searchKeyword} value={searchKeyword}
onChange={(e) => setSearchKeyword(e.target.value)} onChange={(e) => setSearchKeyword(e.target.value)}
onPressEnter={loadTokens} onPressEnter={loadTokens}
style={{ width: 280 }} style={{ width: 340 }}
allowClear allowClear
/> />
<Radio.Group <Radio.Group