|
|
@@ -71,6 +71,10 @@ func GetSumOrderPerfomance(wxUserId, orderType, beginTime, endTime int64) int64
|
|
|
o := orm.NewOrm()
|
|
|
tbn := "orders"
|
|
|
sql := fmt.Sprintf("SELECT sum(`paied_price`-`freight`) as count FROM `%s` WHERE paied_at > %d and paied_at< %d and status in (?, ?, ?) and wx_user_id=? and order_type=?;", tbn, beginTime, endTime)
|
|
|
+ if orderType == int64(2) {
|
|
|
+ beego.BeeLogger.Warn("orders sql=[%s]", sql)
|
|
|
+ }
|
|
|
+
|
|
|
err := o.Raw(sql, order_model.STATUS_PROCESSING, order_model.STATUS_DISPATCH, order_model.STATUS_COMPLETE, wxUserId, orderType).QueryRow(ret)
|
|
|
if err != nil {
|
|
|
beego.BeeLogger.Error("GetSumOrderPerfomance err=[%s]", err)
|
|
|
@@ -94,6 +98,8 @@ func GetSumShopPerfomance(wxUserId, beginTime, endTime int64) int64 {
|
|
|
o := orm.NewOrm()
|
|
|
tbn := "shop_applications"
|
|
|
sql := fmt.Sprintf("SELECT sum(`total`) as count FROM `%s` WHERE pass_time>FROM_UNIXTIME(%d) and pass_time<FROM_UNIXTIME(%d) and status=%d and wx_user_id=%d;", tbn, beginTime, endTime, state, wxUserId)
|
|
|
+ beego.BeeLogger.Warn("shop sql=[%s]", sql)
|
|
|
+
|
|
|
err := o.Raw(sql).QueryRow(ret)
|
|
|
if err != nil {
|
|
|
beego.BeeLogger.Error("GetSumShopPerfomance err=[%s]", err)
|