12345678910111213141516171819202122232425262728 |
- package service
-
- import "XT_New/models"
-
- func GetInspectionMajor(orgid int64) (inspection []*models.XtInspectionReference, err error) {
-
- err = XTReadDB().Model(&inspection).Where("org_id = ? and status = 1", orgid).Group("project_name").Order("id asc").Find(&inspection).Error
- return inspection, err
- }
-
- func GetInspectionMinor(projectid int64) (inspection []*models.XtInspectionReference, err error) {
-
- err = XTReadDB().Model(&inspection).Where("project_id = ? and status = 1", projectid).Find(&inspection).Error
- return inspection, err
- }
-
- func GetInspectionRange(id int64) (models.XtInspectionReference, error) {
- reference := models.XtInspectionReference{}
- err := XTReadDB().Model(&reference).Where("id=? and status = 1", id).Find(&reference).Error
- return reference, err
- }
-
- func SaveInspection(standard *models.XtQualityControlStandard) error {
-
- err := XTWriteDB().Create(&standard).Error
- return err
- }
|