|
|
@@ -13,7 +13,7 @@ import ( |
|
|
|
// 累计自购数 |
|
|
|
func OwnBuyTotal(engine *xorm.Engine, uid interface{}, task map[string]string, t time.Time) string { |
|
|
|
|
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Unix() |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Unix() |
|
|
|
etime := t.Unix() |
|
|
|
//联盟结算后的 |
|
|
|
total, err := db.OrderListCountByUIDByOrderTypeByTime(engine, uid, 0, "1,2,3,5", stime, etime) |
|
|
@@ -21,7 +21,7 @@ func OwnBuyTotal(engine *xorm.Engine, uid interface{}, task map[string]string, t |
|
|
|
zhios_condition_statistics_logx.Warn(err) |
|
|
|
return "" |
|
|
|
} |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()) |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()) |
|
|
|
mallEtime := t |
|
|
|
//确认收货的才算 |
|
|
|
mallTotal, err := db.MallOrdByTimeWithCount(engine, uid, 0, "3", mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
@@ -36,7 +36,7 @@ func OwnBuyTotal(engine *xorm.Engine, uid interface{}, task map[string]string, t |
|
|
|
// 累计已结算佣金 |
|
|
|
func SettleOrderSum(engine *xorm.Engine, uid interface{}, task map[string]string, t time.Time) string { |
|
|
|
|
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Unix() |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Unix() |
|
|
|
etime := t.Unix() |
|
|
|
// 用户分佣的订单 |
|
|
|
idAmountMap, err := db.OrderRelateListByTimeByState(engine, uid, "1,2,3,5", stime, etime) |
|
|
@@ -48,7 +48,7 @@ func SettleOrderSum(engine *xorm.Engine, uid interface{}, task map[string]string |
|
|
|
for _, item := range *idAmountMap { |
|
|
|
sum += item |
|
|
|
} |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()) |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()) |
|
|
|
mallEtime := t |
|
|
|
_, mallSum, err := db.MallOrderRelateListByTimeByState(engine, uid, 3, mallStime, mallEtime) |
|
|
|
if err != nil { |
|
|
@@ -62,8 +62,8 @@ func SettleOrderSum(engine *xorm.Engine, uid interface{}, task map[string]string |
|
|
|
func ExtendCount(engine *xorm.Engine, uid interface{}, task map[string]string, t time.Time) string { |
|
|
|
|
|
|
|
// 累计直推人数 |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Format("2006-1-02 15:04:05") |
|
|
|
etime := t.Format("2006-1-02 15:04:05") |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05") |
|
|
|
etime := t.Format("2006-01-02 15:04:05") |
|
|
|
sqlTpl := `SELECT count(*) as count |
|
|
|
FROM user_profile as up |
|
|
|
LEFT JOIN user as u ON u.uid=up.uid |
|
|
@@ -84,8 +84,8 @@ func ExtendCount(engine *xorm.Engine, uid interface{}, task map[string]string, t |
|
|
|
func TeamCount(engine *xorm.Engine, uid interface{}, task map[string]string, t time.Time) string { |
|
|
|
|
|
|
|
// 累计团队有效直推人数 |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Format("2006-1-02 15:04:05") |
|
|
|
etime := t.Format("2006-1-02 15:04:05") |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05") |
|
|
|
etime := t.Format("2006-01-02 15:04:05") |
|
|
|
sqlTpl := `SELECT count(*) as count |
|
|
|
FROM user_profile as up |
|
|
|
LEFT JOIN user as u ON u.uid=up.uid |
|
|
@@ -108,8 +108,8 @@ func TeamCount(engine *xorm.Engine, uid interface{}, task map[string]string, t t |
|
|
|
|
|
|
|
func TeamByLvCount(engine *xorm.Engine, uid interface{}, task map[string]string, t time.Time) string { |
|
|
|
|
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Format("2006-1-02 15:04:05") |
|
|
|
etime := t.Format("2006-1-02 15:04:05") |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05") |
|
|
|
etime := t.Format("2006-01-02 15:04:05") |
|
|
|
sqlTpl := `SELECT count(*) as count |
|
|
|
FROM user_relate as ur |
|
|
|
LEFT JOIN user as u ON u.uid=ur.uid |
|
|
@@ -132,8 +132,8 @@ func TeamByLvCount(engine *xorm.Engine, uid interface{}, task map[string]string, |
|
|
|
|
|
|
|
func ExtendByLvCount(engine *xorm.Engine, uid interface{}, task map[string]string, t time.Time) string { |
|
|
|
|
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Format("2006-1-02 15:04:05") |
|
|
|
etime := t.Format("2006-1-02 15:04:05") |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05") |
|
|
|
etime := t.Format("2006-01-02 15:04:05") |
|
|
|
|
|
|
|
sqlTpl := `SELECT count(*) as count |
|
|
|
FROM user_relate as ur |
|
|
@@ -159,7 +159,7 @@ func OwnbuySum(engine *xorm.Engine, uid interface{}, task map[string]string, t t |
|
|
|
var total float64 = 0 |
|
|
|
var err error |
|
|
|
if zhios_condition_statistics_utils.InArr(task["task_type_pvd"], []string{"0", "1"}) { |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()).Unix() |
|
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()).Unix() |
|
|
|
etime := t.Unix() |
|
|
|
total, err = db.OrderListPaidPriceByUIDByOrderTypeByTime(engine, uid, 0, "1,2,3,5", stime, etime) |
|
|
|
if err != nil { |
|
|
@@ -168,7 +168,7 @@ func OwnbuySum(engine *xorm.Engine, uid interface{}, task map[string]string, t t |
|
|
|
} |
|
|
|
} |
|
|
|
if zhios_condition_statistics_utils.InArr(task["task_type_pvd"], []string{"0", "2", "8", "9"}) { |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()) |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()) |
|
|
|
mallEtime := t |
|
|
|
orderType := 0 |
|
|
|
if zhios_condition_statistics_utils.InArr(task["task_type_pvd"], []string{"8", "9"}) { |
|
|
@@ -183,7 +183,7 @@ func OwnbuySum(engine *xorm.Engine, uid interface{}, task map[string]string, t t |
|
|
|
total += mallTotal |
|
|
|
} |
|
|
|
if zhios_condition_statistics_utils.InArr(task["task_type_pvd"], []string{"0", "3"}) { |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()) |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()) |
|
|
|
mallEtime := t |
|
|
|
//确认收货的才算 |
|
|
|
o2oTotal, err := db.O2oOrdByTime(engine, uid, 0, "3", mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
@@ -200,7 +200,7 @@ func OwnbuySum(engine *xorm.Engine, uid interface{}, task map[string]string, t t |
|
|
|
total += o2oTotal1 |
|
|
|
} |
|
|
|
if zhios_condition_statistics_utils.InArr(task["task_type_pvd"], []string{"0", "4"}) { |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), t.Hour(), 0, 0, 0, t.Location()) |
|
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-zhios_condition_statistics_utils.StrToInt(task["within_days"]), 0, 0, 0, 0, t.Location()) |
|
|
|
mallEtime := t |
|
|
|
//确认收货的才算 |
|
|
|
b2cTotal, err := db.B2cOrdByTime(engine, uid, 0, "3", mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
|