|
@@ -117,7 +117,7 @@ func (service *IntegralService) IntegralConsumeService(data entity.FlowJSON) (in
|
|
|
//查询积分余额是否充足
|
|
|
b, err := orm.Table("integral_solde").Select("sum(perManEntPoints)+sum(timePoints) as CountPoints ,userId").
|
|
|
Where("appId=? and userId=? and (endDate = '' OR endDate IS NULL OR endDate >= ?) and (( perManEntPoints != 0 AND timePoints = 0 ) OR ( perManEntPoints = 0 AND timePoints != 0 ))", data.AppId, data.UserId, time.Now().Format("2006-01-02")).
|
|
|
- Get(&balance)
|
|
|
+ GroupBy("userId").Get(&balance)
|
|
|
if err != nil {
|
|
|
log.Printf("积分余额查询出错,userId:[%s],err:[%v]", data.UserId, err)
|
|
|
return entity.ErrorCode, "积分余额查询出错", serialNumber
|