feat: 工单筛选支持流程搜索。 (fix #218)

feat: 工单筛选支持流程搜索。 (fix #218)
This commit is contained in:
lanyulei
2021-11-16 22:24:24 +08:00
committed by GitHub

View File

@@ -54,6 +54,7 @@ func (w *WorkOrder) PureWorkOrderList() (result interface{}, err error) {
processor := w.GinObj.DefaultQuery("processor", "") processor := w.GinObj.DefaultQuery("processor", "")
priority := w.GinObj.DefaultQuery("priority", "") priority := w.GinObj.DefaultQuery("priority", "")
creator := w.GinObj.DefaultQuery("creator", "") creator := w.GinObj.DefaultQuery("creator", "")
processParam := w.GinObj.DefaultQuery("process", "")
db := orm.Eloquent.Model(&process.WorkOrderInfo{}). db := orm.Eloquent.Model(&process.WorkOrderInfo{}).
Where("p_work_order_info.title like ?", fmt.Sprintf("%%%v%%", title)) Where("p_work_order_info.title like ?", fmt.Sprintf("%%%v%%", title))
if startTime != "" { if startTime != "" {
@@ -68,6 +69,9 @@ func (w *WorkOrder) PureWorkOrderList() (result interface{}, err error) {
if creator != "" { if creator != "" {
db = db.Where("p_work_order_info.creator = ?", creator) db = db.Where("p_work_order_info.creator = ?", creator)
} }
if processParam != "" {
db = db.Where("p_work_order_info.process = ?", processParam)
}
if processor != "" && w.Classify != 1 { if processor != "" && w.Classify != 1 {
err = orm.Eloquent.Model(&processorInfo). err = orm.Eloquent.Model(&processorInfo).
Where("user_id = ?", processor). Where("user_id = ?", processor).