|
@@ -61,7 +61,20 @@ func (l *AcquirerStudentTotalLogic) AcquirerStudentTotal() (*types.Response, err
|
|
|
var target int64
|
|
var target int64
|
|
|
l.svcCtx.DB.Table("i2bill_mkt_part_time_user").Select("target").Where("user_id = ? and del_flag = 0", userId).Get(&target)
|
|
l.svcCtx.DB.Table("i2bill_mkt_part_time_user").Select("target").Where("user_id = ? and del_flag = 0", userId).Get(&target)
|
|
|
var res = make(map[string]interface{})
|
|
var res = make(map[string]interface{})
|
|
|
- res["check_total"] = totalByCheck
|
|
|
|
|
|
|
+ var invalide, untreated, valide int64
|
|
|
|
|
+ for _, t := range totalByCheck {
|
|
|
|
|
+ switch t["check_state"].(int64) {
|
|
|
|
|
+ case 54, 56, 59:
|
|
|
|
|
+ untreated += t["total"].(int64)
|
|
|
|
|
+ case 57:
|
|
|
|
|
+ valide += t["total"].(int64)
|
|
|
|
|
+ case 58:
|
|
|
|
|
+ invalide += t["total"].(int64)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ res["invalide"] = invalide
|
|
|
|
|
+ res["untreated"] = untreated
|
|
|
|
|
+ res["valide"] = valide
|
|
|
res["today_total"] = totalDay[0]["total"]
|
|
res["today_total"] = totalDay[0]["total"]
|
|
|
res["target"] = target
|
|
res["target"] = target
|
|
|
return &types.Response{200, "", res}, nil
|
|
return &types.Response{200, "", res}, nil
|