From 82fee5973e313e832841221e9cc572582c3269f7 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 3 Apr 2024 09:15:03 +0800 Subject: [PATCH] =?UTF-8?q?1.ipad=E7=AB=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/db_order_list.go | 5 ++++- app/ipad/hdl/hdl_order.go | 1 - app/ipad/hdl/hdl_order_goods.go | 16 +++++++++++++++- app/ipad/svc/svc_order.go | 5 ++++- app/router/ipad_router.go | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/db/db_order_list.go b/app/db/db_order_list.go index 8ad9cae..948c5ac 100644 --- a/app/db/db_order_list.go +++ b/app/db/db_order_list.go @@ -160,9 +160,12 @@ func GetOrderListByIpad(eg *xorm.Engine, param map[string]string) (*[]model.Orde } sess.And("enterprise_id in (?) or oid like ?", php2go.Implode(",", ids), "%"+param["keyword"]+"%") } - if param["state"] != "" { + if param["state"] != "" && param["state"] != "1" { sess.And("state =?", param["state"]) } + if param["state"] == "1" { + sess.In("state", []string{"1", "2"}) + } size := utils.StrToInt(param["limit"]) start := (utils.StrToInt(param["page"]) - 1) * size count, err := sess.Limit(size, start).OrderBy("id asc").FindAndCount(&order) diff --git a/app/ipad/hdl/hdl_order.go b/app/ipad/hdl/hdl_order.go index 7f71ae8..0374e79 100644 --- a/app/ipad/hdl/hdl_order.go +++ b/app/ipad/hdl/hdl_order.go @@ -11,7 +11,6 @@ func OrderCate(c *gin.Context) { {"name": "全部", "id": ""}, {"name": "待制作", "id": "0"}, {"name": "制作中", "id": "1"}, - {"name": "待烘焙", "id": "2"}, {"name": "待分拣", "id": "3"}, {"name": "已完成", "id": "4"}, } diff --git a/app/ipad/hdl/hdl_order_goods.go b/app/ipad/hdl/hdl_order_goods.go index 99d0b51..adaa0de 100644 --- a/app/ipad/hdl/hdl_order_goods.go +++ b/app/ipad/hdl/hdl_order_goods.go @@ -10,6 +10,17 @@ import ( "github.com/gin-gonic/gin" ) +func OrderGoodsCate(c *gin.Context) { + var res = []map[string]string{ + {"name": "全部", "id": ""}, + {"name": "待制作", "id": "0"}, + {"name": "制作中", "id": "1"}, + {"name": "待烘焙", "id": "2"}, + {"name": "已完成", "id": "3"}, + } + e.OutSuc(c, res, nil) + return +} func OrderGoods(c *gin.Context) { var args map[string]string if err := c.ShouldBindJSON(&args); err != nil { @@ -28,7 +39,7 @@ func OrderGoods(c *gin.Context) { scheme, host, subDomain, moreSubDomain := svc.ImageBucketNew(c) var tmpMap interface{} stateArr := []string{"待制作", "制作中", "烘焙中", "分拣中", "已完成", "已取消"} - btnArr := []string{"开始制作", "制作中", "制作完成", "烘焙完成", "分拣完成", "已取消"} + btnArr := []string{"开始制作", "制作完成", "烘焙完成", "已完成", "已完成", "已取消"} for _, v := range *data { var tmp = map[string]string{ "oid": utils.Int64ToStr(v.Oid), @@ -40,6 +51,9 @@ func OrderGoods(c *gin.Context) { "goods_img": "", "state": utils.IntToStr(v.State), } + if v.State == 4 { + tmp["state"] = "3" + } // 商品主图 if goodsMap[v.GoodsId].ImageList != "" { utils.Unserialize([]byte(goodsMap[v.GoodsId].ImageList), &tmpMap) diff --git a/app/ipad/svc/svc_order.go b/app/ipad/svc/svc_order.go index 1107460..b0f2ece 100644 --- a/app/ipad/svc/svc_order.go +++ b/app/ipad/svc/svc_order.go @@ -23,7 +23,7 @@ func Order(c *gin.Context) { } enterpriseMap := db.GetEnterpriseMore(eg, enterpriseIds) stateArr := []string{"待制作", "制作中", "烘焙中", "分拣中", "已完成", "已取消"} - btnArr := []string{"进入制作", "进入制作", "进入制作", "开始分拣", "分拣完成", "已取消"} + btnArr := []string{"进入制作", "进入制作", "进入制作", "分拣完成", "查看详情", "已取消"} for _, v := range *data { enterpriseName := "" _, ok := enterpriseMap[v.EnterpriseId] @@ -38,6 +38,9 @@ func Order(c *gin.Context) { "state": utils.IntToStr(v.State), "enterprise_name": enterpriseName, } + if v.State == 2 { + tmp["state"] = "1" + } list = append(list, tmp) } } diff --git a/app/router/ipad_router.go b/app/router/ipad_router.go index 8d65fc1..8217fa0 100644 --- a/app/router/ipad_router.go +++ b/app/router/ipad_router.go @@ -11,7 +11,7 @@ func IpadInit(r *gin.RouterGroup) { r.Use(mw.Auth) //检测登录状态 r.GET("order/cate", hdl.OrderCate) //订单类目 r.POST("order/list", hdl.Order) //订单 - r.GET("order/goods/cate", hdl.OrderCate) //订单商品类目 + r.GET("order/goods/cate", hdl.OrderGoodsCate) //订单商品类目 r.POST("order/goods/list", hdl.OrderGoods) //订单商品 r.GET("responsible", hdl.Responsible) //负责人 r.POST("order/make/begin", hdl.OrderMakeBegin) //订单开始制作