Browse Source

add Contribution Value Basic Setting

master
shenjiachi 1 month ago
parent
commit
ece7da66a9
6 changed files with 76 additions and 4 deletions
  1. +10
    -0
      src/dao/contribution_value_basic_setting_dao.go
  2. +1
    -1
      src/dao/fin_withdraw_apply_dao.go
  3. +52
    -0
      src/implement/contribution_value_basic_setting_implement.go
  4. +3
    -3
      src/implement/fin_withdraw_apply_implement.go
  5. +9
    -0
      src/model/contribution_value_basic_setting.go
  6. +1
    -0
      src/model/fin_withdraw_apply.go

+ 10
- 0
src/dao/contribution_value_basic_setting_dao.go View File

@@ -0,0 +1,10 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type ContributionValueBasicSettingDao interface {
//TODO:: You can add specific method definitions here
ContributionValueBasicSettingGetOne() (*model.ContributionValueBasicSetting, error)
ContributionValueBasicSettingInsert(m *model.ContributionValueBasicSetting) (int, error)
ContributionValueBasicSettingUpdate(id interface{}, contributionValueBasicSetting *model.ContributionValueBasicSetting, forceColumns ...string) (int64, error)
}

+ 1
- 1
src/dao/fin_withdraw_apply_dao.go View File

@@ -7,5 +7,5 @@ import (

type FinWithdrawApplyDao interface {
//TODO:: You can add specific method definitions here
FinWithdrawApplyGetBySession(session *xorm.Session, startAt, endAt string, params map[string]interface{}) (*[]model.FinWithdrawSetting, error)
FinWithdrawApplyGetBySession(session *xorm.Session, startAt, endAt string, params map[string]interface{}) (*[]model.FinWithdrawApply, error)
}

+ 52
- 0
src/implement/contribution_value_basic_setting_implement.go View File

@@ -0,0 +1,52 @@
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)

func NewContributionValueBasicSettingDb(engine *xorm.Engine) dao.ContributionValueBasicSettingDao {
return &ContributionValueBasicSettingDb{Db: engine}
}

type ContributionValueBasicSettingDb struct {
Db *xorm.Engine
}

func (c ContributionValueBasicSettingDb) ContributionValueBasicSettingGetOne() (*model.ContributionValueBasicSetting, error) {
var m model.ContributionValueBasicSetting
get, err := c.Db.Where("id > 1").Desc("create_at").Get(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if !get {
return nil, nil
}
return &m, nil
}

func (c ContributionValueBasicSettingDb) ContributionValueBasicSettingInsert(m *model.ContributionValueBasicSetting) (int, error) {
_, err := c.Db.InsertOne(m)
if err != nil {
return 0, err
}
return m.Id, nil
}

func (c ContributionValueBasicSettingDb) ContributionValueBasicSettingUpdate(id interface{}, contributionValueBasicSetting *model.ContributionValueBasicSetting, forceColumns ...string) (int64, error) {
var (
affected int64
err error
)
if forceColumns != nil {
affected, err = c.Db.Where("id=?", id).MustCols(forceColumns...).Update(contributionValueBasicSetting)
} else {
affected, err = c.Db.Where("id=?", id).Update(contributionValueBasicSetting)
}
if err != nil {
return 0, err
}
return affected, nil
}

+ 3
- 3
src/implement/fin_withdraw_apply_implement.go View File

@@ -18,9 +18,9 @@ type FinWithdrawApplyDb struct {
Db *xorm.Engine
}

func (f FinWithdrawApplyDb) FinWithdrawApplyGetBySession(session *xorm.Session, startAt, endAt string, params map[string]interface{}) (*[]model.FinWithdrawSetting, error) {
var m *[]model.FinWithdrawSetting
session = session.Where("create_at > >", startAt).And("create_at < ?", endAt)
func (f FinWithdrawApplyDb) FinWithdrawApplyGetBySession(session *xorm.Session, startAt, endAt string, params map[string]interface{}) (*[]model.FinWithdrawApply, error) {
var m *[]model.FinWithdrawApply
session = session.Where("create_at > ?", startAt).And("create_at < ?", endAt)
if reflect.TypeOf(params["value"]).Kind() == reflect.Slice {
//指定In查询
if err := session.In(zhios_order_relate_utils.AnyToString(params["key"]), params["value"]).Find(m); err != nil {


+ 9
- 0
src/model/contribution_value_basic_setting.go View File

@@ -0,0 +1,9 @@
package model

type ContributionValueBasicSetting struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
PostingDynamicLiked int `json:"posting_dynamic_liked" xorm:"not null comment('发布动态被官方点赞') INT(11)"`
PostingCommentLiked int `json:"posting_comment_liked" xorm:"not null comment('发布评论被官方点赞') INT(11)"`
HandOutRedPackage int `json:"hand_out_red_package" xorm:"not null comment('发红包') INT(11)"`
PublishCreation int `json:"publish_creation" xorm:"not null comment('发布创作') INT(11)"`
}

+ 1
- 0
src/model/fin_withdraw_apply.go View File

@@ -12,6 +12,7 @@ type FinWithdrawApply struct {
PaymentDate string `json:"payment_date" xorm:"not null comment('到账时间') DATETIME"`
State int `json:"state" xorm:"not null default 0 comment('0申请中,1通过,2完成,3失败,4处理中(队列)') TINYINT(1)"`
WithdrawKind int `json:"withdraw_kind" xorm:"not null default 1 comment('提现方式(1:支付宝 2:微信)') TINYINT(1)"`
IsFirst int `json:"is_first" xorm:"not null default 0 comment('是否首次提现(0:否 1:是)') TINYINT(1)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注,失败请备注原因') VARCHAR(500)"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('处理时间') TIMESTAMP"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') index TIMESTAMP"`


Loading…
Cancel
Save