From 0746a730f787b1e44c4e1861a4edd2a3d698877d Mon Sep 17 00:00:00 2001 From: lanyulei Date: Tue, 16 Nov 2021 23:58:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E5=8D=95=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=A1=A8=E5=8D=95=E5=86=85=E5=AE=B9=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/workOrderList.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/service/workOrderList.go b/pkg/service/workOrderList.go index 600ef6e..6791ee5 100644 --- a/pkg/service/workOrderList.go +++ b/pkg/service/workOrderList.go @@ -55,8 +55,11 @@ func (w *WorkOrder) PureWorkOrderList() (result interface{}, err error) { priority := w.GinObj.DefaultQuery("priority", "") creator := w.GinObj.DefaultQuery("creator", "") processParam := w.GinObj.DefaultQuery("process", "") + formData := w.GinObj.DefaultQuery("formData", "") db := orm.Eloquent.Model(&process.WorkOrderInfo{}). - Where("p_work_order_info.title like ?", fmt.Sprintf("%%%v%%", title)) + Joins("left join p_work_order_tpl_data on p_work_order_tpl_data.work_order = p_work_order_info.id"). + Where("p_work_order_info.title like ?", fmt.Sprintf("%%%v%%", title)). + Group("p_work_order_info.id") if startTime != "" { db = db.Where("p_work_order_info.create_time >= ?", startTime) } @@ -72,6 +75,9 @@ func (w *WorkOrder) PureWorkOrderList() (result interface{}, err error) { if processParam != "" { db = db.Where("p_work_order_info.process = ?", processParam) } + if formData != "" { + db = db.Where("p_work_order_tpl_data.form_data->'$.*' LIKE CONCAT('%',?,'%')", formData) + } if processor != "" && w.Classify != 1 { err = orm.Eloquent.Model(&processorInfo). Where("user_id = ?", processor).