|
@@ -53,7 +53,7 @@ func NewAnalyzeContactField(ctx context.Context, svcCtx *svc.ServiceContext) *An
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (l *AnalyzeContactField) Analyze() {
|
|
|
+func (l *AnalyzeContactField) Analyze(bot_wxid *string, contact_wxid *string) {
|
|
|
usageDetails := make(map[string]map[string]string)
|
|
|
contactFieldTemplates := make(map[string][]custom_types.ContactFieldTemplate)
|
|
|
template_type_text := "text"
|
|
@@ -151,6 +151,10 @@ func (l *AnalyzeContactField) Analyze() {
|
|
|
yesterdayStart := yesterdayEnd.AddDate(0, 0, -2)
|
|
|
predicates = append(predicates, usagedetail.CreatedAtGTE(yesterdayStart))
|
|
|
predicates = append(predicates, usagedetail.CreatedAtLT(yesterdayEnd))
|
|
|
+ if bot_wxid != nil && *bot_wxid != "" && contact_wxid != nil && *contact_wxid != "" {
|
|
|
+ predicates = append(predicates, usagedetail.BotIDEQ(*bot_wxid))
|
|
|
+ predicates = append(predicates, usagedetail.ReceiverIDEQ(*contact_wxid))
|
|
|
+ }
|
|
|
|
|
|
//todayStart := time.Now().AddDate(0, 0, 0).Truncate(24 * time.Hour)
|
|
|
//todayEnd := todayStart.Add(24 * time.Hour)
|