Browse Source

feat:推送结果预览es查询语句优化

wangchuanjin 1 year ago
parent
commit
7364fa0899
1 changed files with 1 additions and 1 deletions
  1. 1 1
      service/service.go

+ 1 - 1
service/service.go

@@ -157,7 +157,7 @@ func BuyProductList(this *entmanageapplication.BuyProductListReq) *entmanageappl
 	data := JyMysql.SelectBySql(`SELECT a.id,SUM(IF(c.id IS NULL || b.status IS NULL || b.status<0,0,1)) AS use_count,a.empower_count,a.province_count,a.end_time,a.product_type FROM entniche_wait_empower a 
                 LEFT JOIN entniche_power b ON (a.ent_id=? AND a.end_time>=? AND a.id=b.wait_empower_id AND b.status=1)
                 LEFT JOIN entniche_user c ON (b.ent_user_id=c.id)
-                WHERE a.ent_id=? GROUP BY a.id ORDER BY a.create_time DESC`, this.EntId, nowTime, this.EntId)
+                WHERE a.ent_id=? AND a.end_time>=? GROUP BY a.id ORDER BY a.create_time DESC`, this.EntId, nowTime, this.EntId, nowTime)
 	arr := []*entmanageapplication.BuyProductList{}
 	if data != nil && len(*data) > 0 {
 		for _, v := range *data {