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

feat: 工单筛选支持流程搜索。 (fix #218)
This commit is contained in:
lanyulei 2021-11-16 22:24:24 +08:00 committed by GitHub
commit b178d10b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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