|
@@ -386,7 +386,14 @@ func GetFinishCount(blockStarChain string, engine *xorm.Engine, uid interface{}, |
|
|
var err error |
|
|
var err error |
|
|
if task.WithinDays <= 0 { |
|
|
if task.WithinDays <= 0 { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "1"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "1"}) { |
|
|
total, err = db.OrderListPaidPriceByUIDByOrderType(engine, uid, 0, []string{"3", "5"}) |
|
|
|
|
|
|
|
|
state := []string{"3", "5"} |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = []string{"0", "1", "2", "3", "5"} |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = []string{"1", "2", "3", "5"} |
|
|
|
|
|
} |
|
|
|
|
|
total, err = db.OrderListPaidPriceByUIDByOrderType(engine, uid, 0, state) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return "", hasPay, payOrdId |
|
|
return "", hasPay, payOrdId |
|
|
} |
|
|
} |
|
@@ -396,29 +403,50 @@ func GetFinishCount(blockStarChain string, engine *xorm.Engine, uid interface{}, |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"8", "9"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"8", "9"}) { |
|
|
orderType = task.TaskTypePvd |
|
|
orderType = task.TaskTypePvd |
|
|
} |
|
|
} |
|
|
|
|
|
state := "3" |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = "1,2,3" |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = "3" |
|
|
|
|
|
} |
|
|
//确认收货的才算 |
|
|
//确认收货的才算 |
|
|
mallTotal, err := db.MallOrd(engine, uid, orderType, []string{"3"}) |
|
|
|
|
|
|
|
|
mallTotal, err := db.MallOrd(engine, uid, orderType, state) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
|
total += mallTotal |
|
|
total += mallTotal |
|
|
} |
|
|
} |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "3"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "3"}) { |
|
|
|
|
|
state := "3" |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = "1,2,3" |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = "3" |
|
|
|
|
|
} |
|
|
//确认收货的才算 |
|
|
//确认收货的才算 |
|
|
o2oTotal, err := db.O2oOrd(engine, uid, 0, []string{"3"}) |
|
|
|
|
|
|
|
|
o2oTotal, err := db.O2oOrd(engine, uid, 0, state) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
|
total += o2oTotal |
|
|
total += o2oTotal |
|
|
o2oTotal1, err := db.O2oOrdPayToMerchant(engine, uid, 0, []string{"1", "4"}) |
|
|
|
|
|
|
|
|
o2oTotal1, err := db.O2oOrdPayToMerchant(engine, uid, 0, "1,4") |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
|
total += o2oTotal1 |
|
|
total += o2oTotal1 |
|
|
} |
|
|
} |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "4"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "4"}) { |
|
|
|
|
|
state := "3" |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = "1,2,3" |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = "3" |
|
|
|
|
|
} |
|
|
//确认收货的才算 |
|
|
//确认收货的才算 |
|
|
b2cTotal, err := db.B2cOrd(engine, uid, 0, []string{"3"}) |
|
|
|
|
|
|
|
|
b2cTotal, err := db.B2cOrd(engine, uid, 0, state) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
@@ -428,7 +456,14 @@ func GetFinishCount(blockStarChain string, engine *xorm.Engine, uid interface{}, |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "1"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "1"}) { |
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-task.WithinDays, t.Hour(), 0, 0, 0, t.Location()).Unix() |
|
|
stime := time.Date(t.Year(), t.Month(), t.Day()-task.WithinDays, t.Hour(), 0, 0, 0, t.Location()).Unix() |
|
|
etime := t.Unix() |
|
|
etime := t.Unix() |
|
|
total, err = db.OrderListPaidPriceByUIDByOrderTypeByTime(engine, uid, 0, []string{"3", "5"}, stime, etime) |
|
|
|
|
|
|
|
|
state := []string{"3", "5"} |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = []string{"0", "1", "2", "3", "5"} |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = []string{"1", "2", "3", "5"} |
|
|
|
|
|
} |
|
|
|
|
|
total, err = db.OrderListPaidPriceByUIDByOrderTypeByTime(engine, uid, 0, state, stime, etime) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return "", hasPay, payOrdId |
|
|
return "", hasPay, payOrdId |
|
|
} |
|
|
} |
|
@@ -440,8 +475,15 @@ func GetFinishCount(blockStarChain string, engine *xorm.Engine, uid interface{}, |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"8", "9"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"8", "9"}) { |
|
|
orderType = task.TaskTypePvd |
|
|
orderType = task.TaskTypePvd |
|
|
} |
|
|
} |
|
|
|
|
|
state := "3" |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = "1,2,3" |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = "3" |
|
|
|
|
|
} |
|
|
//确认收货的才算 |
|
|
//确认收货的才算 |
|
|
mallTotal, err := db.MallOrdByTime(engine, uid, orderType, []string{"3"}, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
|
|
|
|
|
|
mallTotal, err := db.MallOrdByTime(engine, uid, orderType, state, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
@@ -450,13 +492,20 @@ func GetFinishCount(blockStarChain string, engine *xorm.Engine, uid interface{}, |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "3"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "3"}) { |
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-task.WithinDays, t.Hour(), 0, 0, 0, t.Location()) |
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-task.WithinDays, t.Hour(), 0, 0, 0, t.Location()) |
|
|
mallEtime := t |
|
|
mallEtime := t |
|
|
|
|
|
state := "3" |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = "1,2,3" |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = "3" |
|
|
|
|
|
} |
|
|
//确认收货的才算 |
|
|
//确认收货的才算 |
|
|
o2oTotal, err := db.O2oOrdByTime(engine, uid, 0, []string{"3"}, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
|
|
|
|
|
|
o2oTotal, err := db.O2oOrdByTime(engine, uid, 0, state, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
|
total += o2oTotal |
|
|
total += o2oTotal |
|
|
o2oTotal1, err := db.O2oOrdPayToMerchantByTime(engine, uid, 0, []string{"1", "4"}, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
|
|
|
|
|
|
o2oTotal1, err := db.O2oOrdPayToMerchantByTime(engine, uid, 0, "1,4", mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
@@ -465,8 +514,15 @@ func GetFinishCount(blockStarChain string, engine *xorm.Engine, uid interface{}, |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "4"}) { |
|
|
if zhios_condition_statistics_utils.InArr(zhios_condition_statistics_utils.IntToStr(task.TaskTypePvd), []string{"0", "4"}) { |
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-task.WithinDays, t.Hour(), 0, 0, 0, t.Location()) |
|
|
mallStime := time.Date(t.Year(), t.Month(), t.Day()-task.WithinDays, t.Hour(), 0, 0, 0, t.Location()) |
|
|
mallEtime := t |
|
|
mallEtime := t |
|
|
|
|
|
state := "3" |
|
|
|
|
|
if task.OrdState == 1 { //已付款 |
|
|
|
|
|
state = "1,2,3" |
|
|
|
|
|
} |
|
|
|
|
|
if task.OrdState == 2 { //已完成 |
|
|
|
|
|
state = "3" |
|
|
|
|
|
} |
|
|
//确认收货的才算 |
|
|
//确认收货的才算 |
|
|
b2cTotal, err := db.B2cOrdByTime(engine, uid, 0, []string{"3"}, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
|
|
|
|
|
|
b2cTotal, err := db.B2cOrdByTime(engine, uid, 0, state, mallStime.Format("2006-01-02 15:04:05"), mallEtime.Format("2006-01-02 15:04:05")) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
return zhios_condition_statistics_utils.Float64ToStr(total), hasPay, payOrdId |
|
|
} |
|
|
} |
|
|