|
|
@@ -16,6 +16,24 @@ type SuperCloudIssuancePackageOrdDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (s SuperCloudIssuancePackageOrdDb) InsertSuperCloudIssuancePackageOrd(m *models.SuperCloudIssuancePackageOrd) (id int64, err error) { |
|
|
|
_, err = s.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
id = m.Id |
|
|
|
return id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (s SuperCloudIssuancePackageOrdDb) SaveCloudIssuancePackageOrd(id interface{}, m *models.SuperCloudIssuancePackageOrd, forceColums ...string) (affected int64, err error) { |
|
|
|
if forceColums != nil { |
|
|
|
affected, err = s.Db.Where("id=?", id).Cols(forceColums...).Update(m) |
|
|
|
} else { |
|
|
|
affected, err = s.Db.Where("id=?", id).Update(m) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func (s SuperCloudIssuancePackageOrdDb) UserOrdList(uid interface{}, req md.BuyPackageRecordsRequest) (resp []*md.BuyPackageRecordsResponse, total int64, err error) { |
|
|
|
total, err = s.Db.Table("super_cloud_issuance_package_ord"). |
|
|
|
Join("INNER", "super_cloud_issuance_package_ord", "super_cloud_issuance_package_ord.package_id = super_cloud_issuance_robot_package.id"). |
|
|
|