@@ -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) | |||||
} |
@@ -7,5 +7,5 @@ import ( | |||||
type FinWithdrawApplyDao interface { | type FinWithdrawApplyDao interface { | ||||
//TODO:: You can add specific method definitions here | //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) | |||||
} | } |
@@ -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 | |||||
} |
@@ -18,9 +18,9 @@ type FinWithdrawApplyDb struct { | |||||
Db *xorm.Engine | 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 { | if reflect.TypeOf(params["value"]).Kind() == reflect.Slice { | ||||
//指定In查询 | //指定In查询 | ||||
if err := session.In(zhios_order_relate_utils.AnyToString(params["key"]), params["value"]).Find(m); err != nil { | if err := session.In(zhios_order_relate_utils.AnyToString(params["key"]), params["value"]).Find(m); err != nil { | ||||
@@ -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)"` | |||||
} |
@@ -12,6 +12,7 @@ type FinWithdrawApply struct { | |||||
PaymentDate string `json:"payment_date" xorm:"not null comment('到账时间') DATETIME"` | 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)"` | 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)"` | 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)"` | Memo string `json:"memo" xorm:"not null default '' comment('备注,失败请备注原因') VARCHAR(500)"` | ||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('处理时间') TIMESTAMP"` | 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"` | CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') index TIMESTAMP"` | ||||