fix(query): 支持12位纯数字时间编号(如202609040184)商品编号的精准索引路由
This commit is contained in:
@@ -311,9 +311,9 @@ func (r *Repository) adminConversationBase(ctx context.Context, principal Princi
|
||||
db = db.Joins("LEFT JOIN users AS renter ON renter.id = explicit_lo.renter_id").
|
||||
Joins("LEFT JOIN users AS owner ON owner.id = COALESCE(explicit_lo.owner_id, l.owner_id)").
|
||||
Where("(renter.phone = ? OR owner.phone = ?)", keyword, keyword)
|
||||
} else if strings.HasPrefix(upper, "RO") || strings.HasPrefix(upper, "ORD") || (len(keyword) >= 12 && isAllDigits(keyword)) {
|
||||
} else if strings.HasPrefix(upper, "RO") || strings.HasPrefix(upper, "ORD") {
|
||||
db = db.Where("(explicit_lo.order_no = ? OR c.latest_order_no = ?)", keyword, keyword)
|
||||
} else if strings.HasPrefix(upper, "L") {
|
||||
} else if strings.HasPrefix(upper, "L") || (len(keyword) >= 12 && isAllDigits(keyword)) {
|
||||
db = db.Where("l.listing_no = ?", keyword)
|
||||
} else {
|
||||
db = db.Joins("LEFT JOIN users AS renter ON renter.id = explicit_lo.renter_id").
|
||||
|
||||
Reference in New Issue
Block a user