diff --git a/app/bigData/svc/svc_data.go b/app/bigData/svc/svc_data.go index 43856af..7d80444 100644 --- a/app/bigData/svc/svc_data.go +++ b/app/bigData/svc/svc_data.go @@ -478,8 +478,8 @@ func NewSortingData(c *gin.Context) []map[string]string { } oIds = append(oIds, utils.Int64ToStr(v.Oid)) } - sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku FROM order_goods WHERE oid in (%s) and goods_type=0 GROUP BY enterprise_id,goods_id,sku_id` - sql = fmt.Sprintf(sql, strings.Join(oIds, ",")) + sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku FROM order_goods WHERE oid in (%s) and make_date=%s and goods_type=0 GROUP BY enterprise_id,goods_id,sku_id` + sql = fmt.Sprintf(sql, strings.Join(oIds, ","), now) nativeString, err := db.QueryNativeString(engine, sql) for _, v := range nativeString { skuData := make([]md2.Sku, 0) diff --git a/app/db/db_order_list.go b/app/db/db_order_list.go index 78aea44..eed3798 100644 --- a/app/db/db_order_list.go +++ b/app/db/db_order_list.go @@ -184,7 +184,9 @@ func GetOrderListOutput(eg *xorm.Engine, param map[string]string) *[]model.Order func GetOrderListByIpad(eg *xorm.Engine, param map[string]string) (*[]model.Order, int64) { var order []model.Order sess := eg.Where("state!=5") - + if param["now"] != "" { + sess.And("make_date=?", param["now"]) + } if param["keyword"] != "" { var data []model.Enterprise eg.Where("name like ?", "%"+param["keyword"]+"%").Find(&data) diff --git a/app/ipad/svc/svc_order.go b/app/ipad/svc/svc_order.go index ad2d8a9..41df6d8 100644 --- a/app/ipad/svc/svc_order.go +++ b/app/ipad/svc/svc_order.go @@ -2,6 +2,8 @@ package svc import ( "applet/app/admin/md" + "applet/app/admin/svc/order" + svc2 "applet/app/bigData/svc" "applet/app/db" "applet/app/e" "applet/app/svc" @@ -17,6 +19,7 @@ func Order(c *gin.Context) { return } eg := db.Db + args["now"] = svc2.CommDate() data, _ := db.GetOrderListByIpad(eg, args) list := make([]map[string]string, 0) if data != nil { @@ -28,6 +31,9 @@ func Order(c *gin.Context) { stateArr := []string{"待制作", "制作中", "烘焙中", "分拣中", "已完成", "已取消"} btnArr := []string{"进入制作", "进入制作", "进入制作", "分拣完成", "查看详情", "已取消"} for _, v := range *data { + v2 := &v + v2 = order.JudgePackageOrdOrdState(v2) + v = *v2 enterpriseName := "" _, ok := enterpriseMap[v.EnterpriseId] if ok { @@ -102,8 +108,8 @@ func StateOrder(c *gin.Context) { if goodsMap[v.Gid].ImageList != "" { utils.Unserialize([]byte(goodsMap[v.Gid].ImageList), &tmpMap) var imageListUrlTmp []string - for _, v := range tmpMap.([]interface{}) { - imageListUrlTmp = append(imageListUrlTmp, svc.ImageFormatWithBucketNew(scheme, host, subDomain, moreSubDomain, v.(string))) + for _, v1 := range tmpMap.([]interface{}) { + imageListUrlTmp = append(imageListUrlTmp, svc.ImageFormatWithBucketNew(scheme, host, subDomain, moreSubDomain, v1.(string))) } if imageListUrlTmp != nil { tmp["goods_img"] = imageListUrlTmp[0]