|
@@ -3,6 +3,7 @@ package orm
|
|
import (
|
|
import (
|
|
"log"
|
|
"log"
|
|
"net/http"
|
|
"net/http"
|
|
|
|
+ "time"
|
|
|
|
|
|
"github.com/jinzhu/gorm"
|
|
"github.com/jinzhu/gorm"
|
|
|
|
|
|
@@ -46,7 +47,7 @@ func GetDocumentAll(args map[string]string) (interface{}, error) {
|
|
|
|
|
|
id := args["id"]
|
|
id := args["id"]
|
|
|
|
|
|
- if err := DB().Where("id = ?", id).Find(&document).Error; err != nil {
|
|
|
|
|
|
+ if err := DB().Preload("Jobs", "end <> ?", time.Time{}).Where("id = ?", id).Find(&document).Error; err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
|
|
@@ -150,7 +151,7 @@ func GetDocumentForAdd(args map[string]string) (interface{}, error) {
|
|
|
|
|
|
func GetDocumentExecute(args map[string]string) (interface{}, error) {
|
|
func GetDocumentExecute(args map[string]string) (interface{}, error) {
|
|
var document Document
|
|
var document Document
|
|
- if err := DB().Preload("Jobs").First(&document, args["id"]).Error; err != nil {
|
|
|
|
|
|
+ if err := DB().Preload("Jobs", "end <> ?", time.Time{}).First(&document, args["id"]).Error; err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
|