22 lines
663 B
Go
22 lines
663 B
Go
package test_data
|
|
|
|
import (
|
|
"testData/global"
|
|
"testData/model"
|
|
"testData/request"
|
|
)
|
|
|
|
func GetProductSelection(r *request.ProbabilitySelection) []string {
|
|
var products []string
|
|
global.PostGreSQL.Model(&model.Report{}).Where("step = ? AND created_at BETWEEN Date(?) AND Date(?)",
|
|
r.Step, r.StartDate, r.EndDate).Group("product").Select("product").Find(&products)
|
|
return products
|
|
}
|
|
|
|
func GetLotSelection(r *request.ProbabilitySelection) []string {
|
|
var lots []string
|
|
global.PostGreSQL.Model(&model.Report{}).Where("step = ? AND created_at BETWEEN Date(?) AND Date(?)",
|
|
r.Step, r.StartDate, r.EndDate).Group("lot").Select("lot").Find(&lots)
|
|
return lots
|
|
}
|