Browse Source

update

master
dengbiao 4 months ago
parent
commit
b55cad114a
4 changed files with 33 additions and 0 deletions
  1. +2
    -0
      src/dao/super_cloud_issuance_package_ord_dao.go
  2. +1
    -0
      src/dao/super_cloud_issuance_robot_package_dao.go
  3. +18
    -0
      src/implement/super_cloud_issuance_package_ord_db.go
  4. +12
    -0
      src/implement/super_cloud_issuance_robot_package_db.go

+ 2
- 0
src/dao/super_cloud_issuance_package_ord_dao.go View File

@@ -8,4 +8,6 @@ import (
type SuperCloudIssuancePackageOrdDao interface {
GetCloudIssuancePackageOrd(ordNo string) (m *models.SuperCloudIssuancePackageOrd, err error)
UserOrdList(uid interface{}, req md.BuyPackageRecordsRequest) (resp []*md.BuyPackageRecordsResponse, total int64, err error)
SaveCloudIssuancePackageOrd(id interface{}, m *models.SuperCloudIssuancePackageOrd, forceColums ...string) (affected int64, err error)
InsertSuperCloudIssuancePackageOrd(m *models.SuperCloudIssuancePackageOrd) (id int64, err error)
}

+ 1
- 0
src/dao/super_cloud_issuance_robot_package_dao.go View File

@@ -3,5 +3,6 @@ package dao
import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceRobotPackageDao interface {
GetCloudIssuanceRobotPackage(id int) (m *models.SuperCloudIssuanceRobotPackage, err error)
FindSuperCloudIssuanceRobotPackage(params map[string]interface{}) (m []*models.SuperCloudIssuanceRobotPackage, err error)
}

+ 18
- 0
src/implement/super_cloud_issuance_package_ord_db.go View File

@@ -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").


+ 12
- 0
src/implement/super_cloud_issuance_robot_package_db.go View File

@@ -18,6 +18,18 @@ type SuperCloudIssuanceRobotPackageDb struct {
Db *xorm.Engine
}

func (s SuperCloudIssuanceRobotPackageDb) GetCloudIssuanceRobotPackage(id int) (m *models.SuperCloudIssuanceRobotPackage, err error) {
m = new(models.SuperCloudIssuanceRobotPackage)
has, err := s.Db.Where("id = ?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (s SuperCloudIssuanceRobotPackageDb) FindSuperCloudIssuanceRobotPackage(params map[string]interface{}) (m []*models.SuperCloudIssuanceRobotPackage, err error) {
if params["key"] == nil {
//查询全部数据


Loading…
Cancel
Save