| | |
| | | case constvar.SalesDetailsKeywordTypePrincipal: |
| | | db = db.Joins("left join user on user.id = sales_details.member_id").Where("user.username like ?", fmt.Sprintf("%%%s%%", slf.Keyword)) |
| | | case constvar.SalesDetailsKeywordTypeProductName: |
| | | //db = db.Joins("left join sales_details_product sdp on sdp.sales_details_id = sales_details.id left join product").Where("user.username like ?", fmt.Sprintf("%%%s%%", slf.Keyword)) |
| | | db = db.Joins("left join sales_details_product sdp on sdp.sales_details_id = sales_details.id left join products on sdp.product_id = products.id").Where("products.name like ?", fmt.Sprintf("%%%s%%", slf.Keyword)) |
| | | |
| | | } |
| | | if slf.Preload { |