| | |
| | | Preload("Contact") |
| | | } |
| | | |
| | | if slf.SalesDetailsId != 0 { |
| | | db = db.Where("sales_details_id = ?", slf.SalesDetailsId) |
| | | } |
| | | |
| | | if slf.QuotationId != 0 { |
| | | db = db.Where("quotation_id = ?", slf.QuotationId) |
| | | } |
| | | if slf.SaleChanceId != 0 { |
| | | db = db.Where("sale_chance_id = ?", slf.SaleChanceId) |
| | | } |
| | | if slf.ContactId != 0 { |
| | | db = db.Where("contact_id = ?", slf.ContactId) |
| | | } |
| | | return db |
| | | } |
| | | |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetSalesDetailsId(salesDetailsId int) *ServiceContractSearch { |
| | | slf.SalesDetailsId = salesDetailsId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetQuotationId(quotationId int) *ServiceContractSearch { |
| | | slf.QuotationId = quotationId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetSaleChanceId(saleChanceId int) *ServiceContractSearch { |
| | | slf.SaleChanceId = saleChanceId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetContactId(contactId int) *ServiceContractSearch { |
| | | slf.ContactId = contactId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetPreload(preload bool) *ServiceContractSearch { |
| | | slf.Preload = preload |
| | | return slf |