Explorar el Código

update

add_mode
DengBiao hace 1 año
padre
commit
ab240ee7f5
Se han modificado 1 ficheros con 17 adiciones y 12 borrados
  1. +17
    -12
      app/customer/svc/order/svc_central_kitchen_for_school_order.go

+ 17
- 12
app/customer/svc/order/svc_central_kitchen_for_school_order.go Ver fichero

@@ -17,12 +17,15 @@ func OrderList(req md.CentralKitchenForSchoolOrderListReq, platform string) (m [
sess := db.Db.Desc("id").Where("user_identity_id =?", req.UserIdentityId).
And("create_at >= ? And create_at <= ?", req.StartDate, req.EndDate).Limit(req.Limit, (req.Page-1)*req.Limit)
sess.And("ord_state = ?", req.OrdState)
if platform == "alipay_applet" {
sess.And("pay_way = ?", enum2.PayWayForAli)
}
if platform == "wx_applet" {
sess.And("pay_way = ?", enum2.PayWayForWx)
if req.OrdState == enum.CentralKitchenForSchoolPackageOrdOrdStateForWait {
if platform == "alipay_applet" {
sess.And("pay_way = ?", enum2.PayWayForAli)
}
if platform == "wx_applet" {
sess.And("pay_way = ?", enum2.PayWayForWx)
}
}

total, err = sess.FindAndCount(&m)
if err != nil {
return
@@ -32,13 +35,15 @@ func OrderList(req md.CentralKitchenForSchoolOrderListReq, platform string) (m [

func OrderStatistic(req md.CentralKitchenForSchoolOrderListReq, platform string) (total float64, err error) {
var sql string
if platform == "alipay_applet" {
sql = fmt.Sprintf("SELECT SUM(total_price) AS sum_total FROM central_kitchen_for_school_package_ord where "+
"user_identity_id = '%d' and create_at >= '%s' And create_at <= '%s' and ord_state = '%d' and pay_way = '%d'", req.UserIdentityId, req.StartDate, req.EndDate, req.OrdState, enum2.PayWayForAli)
}
if platform == "wx_applet" {
sql = fmt.Sprintf("SELECT SUM(total_price) AS sum_total FROM central_kitchen_for_school_package_ord where "+
"user_identity_id = '%d' and create_at >= '%s' And create_at <= '%s' and ord_state = '%d' and pay_way = '%d'", req.UserIdentityId, req.StartDate, req.EndDate, req.OrdState, enum2.PayWayForWx)
if req.OrdState == enum.CentralKitchenForSchoolPackageOrdOrdStateForWait {
if platform == "alipay_applet" {
sql = fmt.Sprintf("SELECT SUM(total_price) AS sum_total FROM central_kitchen_for_school_package_ord where "+
"user_identity_id = '%d' and create_at >= '%s' And create_at <= '%s' and ord_state = '%d' and pay_way = '%d'", req.UserIdentityId, req.StartDate, req.EndDate, req.OrdState, enum2.PayWayForAli)
}
if platform == "wx_applet" {
sql = fmt.Sprintf("SELECT SUM(total_price) AS sum_total FROM central_kitchen_for_school_package_ord where "+
"user_identity_id = '%d' and create_at >= '%s' And create_at <= '%s' and ord_state = '%d' and pay_way = '%d'", req.UserIdentityId, req.StartDate, req.EndDate, req.OrdState, enum2.PayWayForWx)
}
}

mapArr1, err := db.QueryNativeString(db.Db, sql)


Cargando…
Cancelar
Guardar