shen hace 4 años
padre
commit
38ba047852

+ 1 - 1
go/gopath/src/fohow.com/apps/models/promotion_model/order_promotion.go

@@ -65,7 +65,7 @@ func GetEffetivePromotions(queryDate time.Time, orderType, depart int64, useCach
 	sql := `
 		select a.* from
 		promotions a left join depart_records_promotions b on a.id=b.promotion_id
-		where DATE_ADD(a.begin_time,INTERVAL 8 HOUR) <= ? and DATE_ADD(a.end_time,INTERVAL 8 HOUR) >= ? and a.order_type = ? and (b.depart_record_id=?)  and a.is_enable = 1 ;
+		where DATE_ADD(a.begin_time,INTERVAL 8 HOUR) <= ? and DATE_ADD(a.end_time,INTERVAL 8 HOUR) >= ? and a.order_type = ? and (b.depart_record_id=? or b.depart_record_id is null ) and a.is_enable = 1 ;
 		`
 
 	_, err := orm.NewOrm().Raw(sql, queryDate.Format("2006-01-02 15:04:05"), queryDate.Format("2006-01-02 15:04:05"), orderType, depart).QueryRows(&list)