浏览代码

update

add_mode
DengBiao 1年前
父节点
当前提交
ab240ee7f5
共有 1 个文件被更改,包括 17 次插入12 次删除
  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 查看文件

@@ -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)


正在加载...
取消
保存