From 224692f475a407f99c7258173753ee011447e71f Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 26 Jun 2024 11:53:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E5=8F=91=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/super_cloud_issuance_copy_writing_dao.go | 4 +++- .../super_cloud_issuance_goods_category_dao.go | 4 +++- src/dao/super_cloud_issuance_goods_dao.go | 4 +++- ..._cloud_issuance_user_robot_bind_circle_dao.go | 6 ++++-- .../super_cloud_issuance_copy_writing_db.go | 9 +++++++++ .../super_cloud_issuance_goods_category_db.go | 10 ++++++++++ src/implement/super_cloud_issuance_goods_db.go | 16 ++++++++++++++++ ...r_cloud_issuance_user_robot_bind_circle_db.go | 10 +++++++++- src/models/super_cloud_issuance_goods.go | 1 + 9 files changed, 58 insertions(+), 6 deletions(-) diff --git a/src/dao/super_cloud_issuance_copy_writing_dao.go b/src/dao/super_cloud_issuance_copy_writing_dao.go index f4d6bf8..7b4e8da 100644 --- a/src/dao/super_cloud_issuance_copy_writing_dao.go +++ b/src/dao/super_cloud_issuance_copy_writing_dao.go @@ -1,5 +1,7 @@ package dao +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + type SuperCloudIssuanceCopyWritingDao interface { - //TODO:: You can add specific method definitions here + FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) } diff --git a/src/dao/super_cloud_issuance_goods_category_dao.go b/src/dao/super_cloud_issuance_goods_category_dao.go index ee59c16..60c0441 100644 --- a/src/dao/super_cloud_issuance_goods_category_dao.go +++ b/src/dao/super_cloud_issuance_goods_category_dao.go @@ -1,5 +1,7 @@ package dao +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + type SuperCloudIssuanceGoodsCategoryDao interface { - //TODO:: You can add specific method definitions here + FindSuperCloudIssuanceGoodsCategory(start, limit int) (mm *[]models.SuperCloudIssuanceGoodsCategory, err error) } diff --git a/src/dao/super_cloud_issuance_goods_dao.go b/src/dao/super_cloud_issuance_goods_dao.go index 4dcb821..da109a9 100644 --- a/src/dao/super_cloud_issuance_goods_dao.go +++ b/src/dao/super_cloud_issuance_goods_dao.go @@ -1,5 +1,7 @@ package dao +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + type SuperCloudIssuanceGoodsDao interface { - //TODO:: You can add specific method definitions here + FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) } diff --git a/src/dao/super_cloud_issuance_user_robot_bind_circle_dao.go b/src/dao/super_cloud_issuance_user_robot_bind_circle_dao.go index 4eb0a62..fffcaeb 100644 --- a/src/dao/super_cloud_issuance_user_robot_bind_circle_dao.go +++ b/src/dao/super_cloud_issuance_user_robot_bind_circle_dao.go @@ -1,5 +1,7 @@ -package dao +package dao + +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" type SuperCloudIssuanceUserRobotBindCircleDao interface { - //TODO:: You can add specific method definitions here + GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) } diff --git a/src/implement/super_cloud_issuance_copy_writing_db.go b/src/implement/super_cloud_issuance_copy_writing_db.go index 4fc4ed9..f183c8a 100644 --- a/src/implement/super_cloud_issuance_copy_writing_db.go +++ b/src/implement/super_cloud_issuance_copy_writing_db.go @@ -2,6 +2,8 @@ package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -12,3 +14,10 @@ type SuperCloudIssuanceCopyWritingDb struct { func NewSuperCloudIssuanceCopyWritingDb(engine *xorm.Engine) dao.SuperCloudIssuanceCopyWritingDao { return &SuperCloudIssuanceCopyWritingDb{Db: engine} } +func (h SuperCloudIssuanceCopyWritingDb) FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) { + var m []models.SuperCloudIssuanceCopyWriting + if err := h.Db.Where("1=1").Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/super_cloud_issuance_goods_category_db.go b/src/implement/super_cloud_issuance_goods_category_db.go index a92f92b..47ae306 100644 --- a/src/implement/super_cloud_issuance_goods_category_db.go +++ b/src/implement/super_cloud_issuance_goods_category_db.go @@ -2,6 +2,8 @@ package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -12,3 +14,11 @@ type SuperCloudIssuanceGoodsCategoryDb struct { func NewSuperCloudIssuanceGoodsCategoryDb(engine *xorm.Engine) dao.SuperCloudIssuanceGoodsCategoryDao { return &SuperCloudIssuanceGoodsCategoryDb{Db: engine} } + +func (h SuperCloudIssuanceGoodsCategoryDb) FindSuperCloudIssuanceGoodsCategory(start, limit int) (mm *[]models.SuperCloudIssuanceGoodsCategory, err error) { + var m []models.SuperCloudIssuanceGoodsCategory + if err := h.Db.Where("1=1").Limit(limit, start).Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/super_cloud_issuance_goods_db.go b/src/implement/super_cloud_issuance_goods_db.go index 4cf0c78..0287a23 100644 --- a/src/implement/super_cloud_issuance_goods_db.go +++ b/src/implement/super_cloud_issuance_goods_db.go @@ -2,6 +2,8 @@ package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -12,3 +14,17 @@ type SuperCloudIssuanceGoodsDb struct { func NewSuperCloudIssuanceGoodsDb(engine *xorm.Engine) dao.SuperCloudIssuanceGoodsDao { return &SuperCloudIssuanceGoodsDb{Db: engine} } +func (h SuperCloudIssuanceGoodsDb) FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) { + var m []models.SuperCloudIssuanceGoods + sess := h.Db.Where("1=1") + if cid > 0 { + sess.And("cloud_issuance_category_id=?", cid) + } + if id != "" { + sess.And("id=?", id) + } + if err := sess.Limit(limit, start).OrderBy("create_at desc,id desc").Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/super_cloud_issuance_user_robot_bind_circle_db.go b/src/implement/super_cloud_issuance_user_robot_bind_circle_db.go index bbd489e..991b7de 100644 --- a/src/implement/super_cloud_issuance_user_robot_bind_circle_db.go +++ b/src/implement/super_cloud_issuance_user_robot_bind_circle_db.go @@ -1,7 +1,8 @@ -package implement +package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" "xorm.io/xorm" ) @@ -12,3 +13,10 @@ type SuperCloudIssuanceUserRobotBindCircleDb struct { func NewSuperCloudIssuanceUserRobotBindCircleDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindCircleDao { return &SuperCloudIssuanceUserRobotBindCircleDb{Db: engine} } +func (h SuperCloudIssuanceUserRobotBindCircleDb) GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) { + var m models.SuperCloudIssuanceUserRobotBindCircle + if has, err := h.Db.Where("robot_id=? and uid=?", robotId, uid).Get(&m); err != nil || has == false { + return nil + } + return &m +} diff --git a/src/models/super_cloud_issuance_goods.go b/src/models/super_cloud_issuance_goods.go index 47fd848..a73e2e6 100644 --- a/src/models/super_cloud_issuance_goods.go +++ b/src/models/super_cloud_issuance_goods.go @@ -18,6 +18,7 @@ type SuperCloudIssuanceGoods struct { GoodsContent string `json:"goods_content" xorm:"comment('商品文案(以json存)') LONGTEXT"` GoodsImg string `json:"goods_img" xorm:"comment('商品主图') VARCHAR(255)"` GoodsImgUrl string `json:"goods_img_url" xorm:"comment('商品主图URL') VARCHAR(255)"` + Commission string `json:"commission" xorm:"comment('佣金比例') VARCHAR(255)"` CreateAt string `json:"create_at" xorm:"not null DATETIME"` UpdateAt string `json:"update_at" xorm:"not null DATETIME"` CloudIssuanceCategoryId int `json:"cloud_issuance_category_id" xorm:"not null default 0 comment('云发单所属分类id') INT(11)"`