Merge branch 'sxy' into dev
This commit is contained in:
commit
46839556cd
@ -224,7 +224,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
|
|
||||||
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *model.BundleProfile, err error) {
|
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *model.BundleProfile, err error) {
|
||||||
var data model.BundleProfile
|
var data model.BundleProfile
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? AND deleted_at = 0", req.Uuid).
|
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? ", req.Uuid).
|
||||||
Preload("BundleProfileLang").
|
Preload("BundleProfileLang").
|
||||||
Preload("BundleToValueAddService").
|
Preload("BundleToValueAddService").
|
||||||
First(&data).Error
|
First(&data).Error
|
||||||
@ -237,7 +237,7 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *model.BundleProfile,
|
|||||||
// 套餐上下架
|
// 套餐上下架
|
||||||
func HandShelf(uuid string, shelfStatus int64) (res *bundle.CommonResponse, err error) {
|
func HandShelf(uuid string, shelfStatus int64) (res *bundle.CommonResponse, err error) {
|
||||||
res = new(bundle.CommonResponse)
|
res = new(bundle.CommonResponse)
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? AND deleted_at = 0", uuid).Update("shelf_status", shelfStatus).Error
|
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", uuid).Update("shelf_status", shelfStatus).Error
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = "套餐上下架操作失败"
|
res.Msg = "套餐上下架操作失败"
|
||||||
@ -275,7 +275,7 @@ func TxCreateBundleLang(tx *gorm.DB, req *model.BundleProfileLang) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
func TxUpdateBundle(tx *gorm.DB, uuid string, columns map[string]interface{}) (err error) {
|
func TxUpdateBundle(tx *gorm.DB, uuid string, columns map[string]interface{}) (err error) {
|
||||||
err = tx.Model(&model.BundleProfile{}).Where("uuid =? and deleted_at = 0", uuid).Updates(columns).Error
|
err = tx.Model(&model.BundleProfile{}).Where("uuid =?", uuid).Updates(columns).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
|
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user