瀏覽代碼

更新

master
huangjiajun 8 月之前
父節點
當前提交
7336c78017
共有 2 個文件被更改,包括 16 次插入0 次删除
  1. +9
    -0
      db/db_b2c_ord.go
  2. +7
    -0
      hdl/hdl_condition.go

+ 9
- 0
db/db_b2c_ord.go 查看文件

@@ -29,6 +29,15 @@ func B2cOrdByTime(Db *xorm.Engine, uid, buyType, state, stime, etime interface{}
return total, nil

}
func B2cOrdByTimeWithCount(Db *xorm.Engine, uid, buyType, state, stime, etime interface{}) (int64, error) {
total, err := Db.Where("uid = ? AND confirm_time > ? AND confirm_time < ?", uid, stime, etime).In("state", state).Count(&model.B2cOrd{})
fmt.Println(err)
fmt.Println(total)
if err != nil {
return 0, zhios_condition_statistics_logx.Error(err)
}
return total, nil
}

func B2cOrd(Db *xorm.Engine, uid, buyType, state interface{}, isSettle int) (float64, error) {
sess := Db.Where("uid = ? ", uid)


+ 7
- 0
hdl/hdl_condition.go 查看文件

@@ -30,6 +30,13 @@ func OwnBuyTotal(engine *xorm.Engine, uid interface{}, task map[string]string, t
return zhios_condition_statistics_utils.Int64ToStr(total)
}
total += mallTotal
//确认收货的才算
b2cTotal, err := db.MallOrdByTimeWithCount(engine, uid, 0, []string{"3", "4"}, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05"))
if err != nil {
zhios_condition_statistics_logx.Warn(err)
return zhios_condition_statistics_utils.Int64ToStr(total)
}
total += b2cTotal
return zhios_condition_statistics_utils.Int64ToStr(total)
}



Loading…
取消
儲存