|
@@ -758,7 +758,7 @@ func GetNormDataByOrgId(orgid int64) (standard []*models.QualityControlStandard,
|
758
|
758
|
table := XTReadDB().Table("xt_inspection_reference as s")
|
759
|
759
|
fmt.Println(table)
|
760
|
760
|
|
761
|
|
- err = db.Order("x.sort asc,x.created_time desc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,s.unit,s.project_name,s.item_name,x.range_value,x.range_type").
|
|
761
|
+ err = db.Order("x.sort asc,x.created_time asc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,s.unit,s.project_name,s.item_name,x.range_value,x.range_type").
|
762
|
762
|
Joins("left join xt_inspection_reference as s on s.id = x.inspection_minor").Scan(&standard).Error
|
763
|
763
|
return standard, err
|
764
|
764
|
}
|
|
@@ -772,7 +772,7 @@ func GetNormData(orgid int64) (standard []*models.QualityControlStandard, err er
|
772
|
772
|
table := XTReadDB().Table("xt_inspection_reference as s")
|
773
|
773
|
fmt.Println(table)
|
774
|
774
|
|
775
|
|
- err = db.Order("x.sort asc,x.created_time desc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,s.unit,s.project_name,s.item_name").
|
|
775
|
+ err = db.Order("x.sort asc,x.created_time asc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,s.unit,s.project_name,s.item_name").
|
776
|
776
|
Joins("left join xt_inspection_reference as s on s.id = x.inspection_minor").Scan(&standard).Error
|
777
|
777
|
return standard, err
|
778
|
778
|
}
|
|
@@ -822,7 +822,7 @@ func GetQuarterTotalCount(orgid int64, startime int64, endtime int64, lapseto in
|
822
|
822
|
q := XTReadDB().Table("x.xt_quality_control_standard as q")
|
823
|
823
|
fmt.Println(q)
|
824
|
824
|
if orgid > 0 {
|
825
|
|
- db = db.Where("x.org_id = ? and x.inspect_value <> 0 and r.range_type = 1", orgid)
|
|
825
|
+ db = db.Where("x.org_id = ? and x.inspect_value+0 <> 0 and r.range_type = 1 and q.user_org_id = ?", orgid, orgid)
|
826
|
826
|
}
|
827
|
827
|
if startime > 0 {
|
828
|
828
|
db = db.Where("x.inspect_date >=?", startime)
|
|
@@ -850,7 +850,7 @@ func GetQuarterTotalCountTwo(orgid int64, startime int64, endtime int64, lapseto
|
850
|
850
|
q := XTReadDB().Table("x.xt_quality_control_standard as q")
|
851
|
851
|
fmt.Println(q)
|
852
|
852
|
if orgid > 0 {
|
853
|
|
- db = db.Where("x.org_id = ? and r.range_type = 2", orgid)
|
|
853
|
+ db = db.Where("x.org_id = ? and r.range_type = 2 and q.user_org_id = ? and x.inspect_value <>''", orgid, orgid)
|
854
|
854
|
}
|
855
|
855
|
if startime > 0 {
|
856
|
856
|
db = db.Where("x.inspect_date >=?", startime)
|