|
|
@@ -56,8 +56,8 @@ func (s CustCustomerBidRecordService) Get(ctx context.Context, id int) (*model.C
|
|
|
|
|
|
func (s CustCustomerBidRecordService) List(ctx context.Context, req *model.CustCustomerBidRecordListReq) (int, []*model.CustCustomerBidRecord, error) {
|
|
|
ctx = context.WithValue(ctx, "contextService", s)
|
|
|
- dao := s.Dao.As("bid").DataScope(ctx, "customer", "sales_id").Unscoped().WhereNull("bid.deleted_time").
|
|
|
- LeftJoin(s.CustomerDao.Table, "customer", "bid.cust_id=customer.id AND `customer`.`deleted_time` IS NULL ")
|
|
|
+ dao := s.CustomerDao.As("customer").DataScope(ctx, "sales_id").
|
|
|
+ LeftJoin(s.Dao.Table, "bid", "bid.cust_id=customer.id").WhereNot("bid.id", 0)
|
|
|
if req.SearchText != "" {
|
|
|
likestr := fmt.Sprintf("%%%s%%", req.SearchText)
|
|
|
dao = dao.Where("(bid.cuct_name LIKE ? || bid.product_name LIKE ? || bid.title LIKE ? || bid.bidder LIKE ?)", likestr, likestr, likestr, likestr)
|