This commit is contained in:
jhc 2023-04-07 09:43:09 +08:00
commit 3eda8edeea

View File

@ -168,7 +168,7 @@ func ExistPayApproval(in *approval.CreateRequest) bool {
// //
subQuery1 := DB.Model(&Approval{}).Where(&Approval{SubmitterID: in.SubmitterID, Type: TypeBundlePayPrice}). subQuery1 := DB.Model(&Approval{}).Where(&Approval{SubmitterID: in.SubmitterID, Type: TypeBundlePayPrice}).
Where("status in (?)",[]uint64{StatusDoing,StatusOk}). Where("status in (?)", []uint64{StatusDoing, StatusOk}).
Select("id") Select("id")
DB.Model(&BundlePayPrice{}).Where("approval_id in (?)", subQuery1).Where(&BundlePayPrice{ShowUid: in.BundlePayPrice.ShowUid}).Count(&count) DB.Model(&BundlePayPrice{}).Where("approval_id in (?)", subQuery1).Where(&BundlePayPrice{ShowUid: in.BundlePayPrice.ShowUid}).Count(&count)
@ -532,7 +532,9 @@ func MyAllWorkApprovals(in *approval.ListRequest) ([]*Approval, int64) {
Preload("BundlePayPrice"). Preload("BundlePayPrice").
Preload("ApprovalType.ApprovalTypeGroup"). Preload("ApprovalType.ApprovalTypeGroup").
Preload("ExhibitionReward.ApprovalExhibitions"). Preload("ExhibitionReward.ApprovalExhibitions").
Preload("ApprovalWorkFlows"). Preload("ApprovalWorkFlows", func(db *gorm.DB) *gorm.DB {
return db.Order("level asc")
}).
Preload("Exhibition.ApprovalExhibitions") Preload("Exhibition.ApprovalExhibitions")
//我未阅读的和我未操作的 //我未阅读的和我未操作的
@ -680,7 +682,9 @@ func MySubmitApprovals(in *approval.ListRequest) ([]*Approval, int64) {
Preload("Work.ApprovalWorks"). Preload("Work.ApprovalWorks").
Preload("Bundle"). Preload("Bundle").
Preload("BundlePayPrice"). Preload("BundlePayPrice").
Preload("ApprovalWorkFlows"). Preload("ApprovalWorkFlows", func(db *gorm.DB) *gorm.DB {
return db.Order("level asc")
}).
Preload("ExhibitionReward.ApprovalExhibitions"). Preload("ExhibitionReward.ApprovalExhibitions").
Preload("ApprovalType.ApprovalTypeGroup"). Preload("ApprovalType.ApprovalTypeGroup").
Preload("Exhibition.ApprovalExhibitions") Preload("Exhibition.ApprovalExhibitions")