@@ -0,0 +1,5 @@ | |||||
package dao | |||||
type HoneyDividendBasicDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
} |
@@ -4,4 +4,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
type SuperCloudIssuanceCopyWritingDao interface { | type SuperCloudIssuanceCopyWritingDao interface { | ||||
FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) | FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) | ||||
GetSuperCloudIssuanceCopyWriting(pvd string) (m *models.SuperCloudIssuanceCopyWriting, err error) | |||||
} | } |
@@ -4,4 +4,6 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
type SuperCloudIssuanceGoodsDao interface { | type SuperCloudIssuanceGoodsDao interface { | ||||
FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) | FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) | ||||
GetSuperCloudIssuanceGoodByCategory(categoryId int) (m *models.SuperCloudIssuanceGoods, err error) | |||||
DeleteCloudIssuanceGoods(id interface{}) (affected int64, err error) | |||||
} | } |
@@ -4,4 +4,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
type SuperCloudIssuanceUserRobotBindCircleDao interface { | type SuperCloudIssuanceUserRobotBindCircleDao interface { | ||||
GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) | GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) | ||||
GetSuperCloudIssuanceUserRobotBindCircleByCategory(uid, categoryId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) | |||||
} | } |
@@ -10,4 +10,5 @@ type SuperCloudIssuanceUserRobotDao interface { | |||||
SaveSuperCloudIssuanceUserRobot(id interface{}, m *models.SuperCloudIssuanceUserRobot, forceColums ...string) (affected int64, err error) | SaveSuperCloudIssuanceUserRobot(id interface{}, m *models.SuperCloudIssuanceUserRobot, forceColums ...string) (affected int64, err error) | ||||
GetCloudIssuanceUserFreeRobot() (m *models.SuperCloudIssuanceUserRobot, err error) | GetCloudIssuanceUserFreeRobot() (m *models.SuperCloudIssuanceUserRobot, err error) | ||||
InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) | InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) | ||||
FindOnLineCloudIssuanceUserRobot() (m []*models.SuperCloudIssuanceUserRobot, err error) | |||||
} | } |
@@ -0,0 +1,14 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | |||||
"xorm.io/xorm" | |||||
) | |||||
type HoneyDividendBasicDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func NewHoneyDividendBasicDb(engine *xorm.Engine) dao.HoneyDividendBasicDao { | |||||
return &HoneyDividendBasicDb{Db: engine} | |||||
} |
@@ -14,6 +14,19 @@ type SuperCloudIssuanceCopyWritingDb struct { | |||||
func NewSuperCloudIssuanceCopyWritingDb(engine *xorm.Engine) dao.SuperCloudIssuanceCopyWritingDao { | func NewSuperCloudIssuanceCopyWritingDb(engine *xorm.Engine) dao.SuperCloudIssuanceCopyWritingDao { | ||||
return &SuperCloudIssuanceCopyWritingDb{Db: engine} | return &SuperCloudIssuanceCopyWritingDb{Db: engine} | ||||
} | } | ||||
func (h SuperCloudIssuanceCopyWritingDb) GetSuperCloudIssuanceCopyWriting(pvd string) (m *models.SuperCloudIssuanceCopyWriting, err error) { | |||||
m = new(models.SuperCloudIssuanceCopyWriting) | |||||
has, err := h.Db.Where("provider = ?", pvd).Get(m) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return m, nil | |||||
} | |||||
func (h SuperCloudIssuanceCopyWritingDb) FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) { | func (h SuperCloudIssuanceCopyWritingDb) FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) { | ||||
var m []models.SuperCloudIssuanceCopyWriting | var m []models.SuperCloudIssuanceCopyWriting | ||||
if err := h.Db.Where("1=1").Find(&m); err != nil { | if err := h.Db.Where("1=1").Find(&m); err != nil { | ||||
@@ -7,13 +7,34 @@ import ( | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
func NewSuperCloudIssuanceGoodsDb(engine *xorm.Engine) dao.SuperCloudIssuanceGoodsDao { | |||||
return &SuperCloudIssuanceGoodsDb{Db: engine} | |||||
} | |||||
type SuperCloudIssuanceGoodsDb struct { | type SuperCloudIssuanceGoodsDb struct { | ||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func NewSuperCloudIssuanceGoodsDb(engine *xorm.Engine) dao.SuperCloudIssuanceGoodsDao { | |||||
return &SuperCloudIssuanceGoodsDb{Db: engine} | |||||
func (h SuperCloudIssuanceGoodsDb) DeleteCloudIssuanceGoods(id interface{}) (affected int64, err error) { | |||||
_, err = h.Db.Where("id=?", id).Delete(models.SuperCloudIssuanceGoods{}) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return 1, nil | |||||
} | } | ||||
func (h SuperCloudIssuanceGoodsDb) GetSuperCloudIssuanceGoodByCategory(categoryId int) (m *models.SuperCloudIssuanceGoods, err error) { | |||||
m = new(models.SuperCloudIssuanceGoods) | |||||
has, err := h.Db.Where("cloud_issuance_category_id = ?", categoryId).OrderBy("id ASC").Get(m) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return m, nil | |||||
} | |||||
func (h SuperCloudIssuanceGoodsDb) FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) { | func (h SuperCloudIssuanceGoodsDb) FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) { | ||||
var m []models.SuperCloudIssuanceGoods | var m []models.SuperCloudIssuanceGoods | ||||
sess := h.Db.Where("1=1") | sess := h.Db.Where("1=1") | ||||
@@ -6,13 +6,22 @@ import ( | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
func NewSuperCloudIssuanceUserRobotBindCircleDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindCircleDao { | |||||
return &SuperCloudIssuanceUserRobotBindCircleDb{Db: engine} | |||||
} | |||||
type SuperCloudIssuanceUserRobotBindCircleDb struct { | type SuperCloudIssuanceUserRobotBindCircleDb struct { | ||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func NewSuperCloudIssuanceUserRobotBindCircleDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindCircleDao { | |||||
return &SuperCloudIssuanceUserRobotBindCircleDb{Db: engine} | |||||
func (h SuperCloudIssuanceUserRobotBindCircleDb) GetSuperCloudIssuanceUserRobotBindCircleByCategory(uid, categoryId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) { | |||||
var m models.SuperCloudIssuanceUserRobotBindCircle | |||||
if has, err := h.Db.Where("uid =? AND goods_category_id =? AND state =1", uid, categoryId).Get(&m); err != nil || has == false { | |||||
return nil | |||||
} | |||||
return &m | |||||
} | } | ||||
func (h SuperCloudIssuanceUserRobotBindCircleDb) GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) { | func (h SuperCloudIssuanceUserRobotBindCircleDb) GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) { | ||||
var m models.SuperCloudIssuanceUserRobotBindCircle | var m models.SuperCloudIssuanceUserRobotBindCircle | ||||
if has, err := h.Db.Where("robot_id=? and uid=?", robotId, uid).Get(&m); err != nil || has == false { | if has, err := h.Db.Where("robot_id=? and uid=?", robotId, uid).Get(&m); err != nil || has == false { | ||||
@@ -26,6 +26,14 @@ type SuperCloudIssuanceUserRobotDb struct { | |||||
MasterId string `json:"master_id"` | MasterId string `json:"master_id"` | ||||
} | } | ||||
func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) FindOnLineCloudIssuanceUserRobot() (m []*models.SuperCloudIssuanceUserRobot, err error) { | |||||
err = superCloudIssuanceUserRobotDb.Db.Where("login_status =? AND is_enabled =0", 1).OrderBy("id ASC").Find(&m) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return m, nil | |||||
} | |||||
func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) { | func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) { | ||||
_, err = superCloudIssuanceUserRobotDb.Db.InsertOne(m) | _, err = superCloudIssuanceUserRobotDb.Db.InsertOne(m) | ||||
if err != nil { | if err != nil { | ||||
@@ -0,0 +1,16 @@ | |||||
package models | |||||
type HoneyDividendBasic struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
IsOpen int `json:"is_open" xorm:"not null default 1 comment('是否开启(1:开启 2:关闭)') TINYINT(1)"` | |||||
NowHoneyValues string `json:"now_honey_values" xorm:"not null default 0.0000 comment('现有蜂蜜数量') DECIMAL(10,4)"` | |||||
DestroyHoneyValues string `json:"destroy_honey_values" xorm:"not null default 0.0000 comment('销毁蜂蜜数量') DECIMAL(10,4)"` | |||||
DividendVipLevel int `json:"dividend_vip_level" xorm:"not null default 0 comment('分红会员等级(大于等于)') INT(11)"` | |||||
OneYuanAmountProduceHoneyValues string `json:"one_yuan_amount_produce_honey_values" xorm:"not null default 0.0000 comment('一元销售额产生x蜂蜜') DECIMAL(10,4)"` | |||||
RecommendOnePersonProduceHoneyValues string `json:"recommend_one_person_produce_honey_values" xorm:"not null default 0.0000 comment('推荐一人产生x蜂蜜') DECIMAL(10,4)"` | |||||
UserRegisterProduceHoneyValues string `json:"user_register_produce_honey_values" xorm:"not null default 0.0000 comment('新用户注册产生x蜂蜜') DECIMAL(10,4)"` | |||||
EveryMonthExchangeOneCashDestroyHoneyValues string `json:"every_month_exchange_one_cash_destroy_honey_values" xorm:"not null default 0.0000 comment('每月兑换一次现金销毁x蜂蜜') DECIMAL(10,4)"` | |||||
CoinId int `json:"coin_id" xorm:"not null default 0 comment('虚拟币id(作用于蜂蜜)') INT(11)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package models | |||||
import ( | |||||
"time" | |||||
) | |||||
type HoneyDividendsRecords struct { | |||||
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` | |||||
Amount string `json:"amount" xorm:"not null default 0.00000000 comment('分红值') DECIMAL(10,8)"` | |||||
UserNums int `json:"user_nums" xorm:"not null default 0 comment('参与分红人数') INT(11)"` | |||||
TotalHoneyValues string `json:"total_honey_values" xorm:"not null default 0.0000 comment('现场蜂蜜数') DECIMAL(10,4)"` | |||||
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"` | |||||
State int32 `json:"state" xorm:"not null default 0 comment('状态(0:待分红 1:分红已完成)') TINYINT(1)"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |
@@ -0,0 +1,10 @@ | |||||
package models | |||||
type HoneyDividendsRecordsWithFlow struct { | |||||
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` | |||||
RecordsId int `json:"records_id" xorm:"not null default 0 comment('记录id') INT(11)"` | |||||
Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"` | |||||
Amount string `json:"amount" xorm:"not null default 0.0000 comment('金额') DECIMAL(10,4)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |