@@ -0,0 +1,7 @@ | |||||
package dao | |||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
type AdminLogDao interface { | |||||
FindAdminLogAndTotal(page, limit, types, memo, startTime, endTime string) (*[]model.AdminLog, int64, error) | |||||
} |
@@ -7,4 +7,5 @@ type EggEnergyCommunityDividendsWithUserDao interface { | |||||
EggEnergyCommunityDividendsWithUserInsert(EggEnergyCommunityDividendsWithUser *model.EggEnergyCommunityDividendsWithUser) (int, error) | EggEnergyCommunityDividendsWithUserInsert(EggEnergyCommunityDividendsWithUser *model.EggEnergyCommunityDividendsWithUser) (int, error) | ||||
EggEnergyCommunityDividendsWithUserFindAndCount(page, limit int, uid int64) ([]*model.EggEnergyCommunityDividendsWithUser, int64, error) | EggEnergyCommunityDividendsWithUserFindAndCount(page, limit int, uid int64) ([]*model.EggEnergyCommunityDividendsWithUser, int64, error) | ||||
EggEnergyCommunityDividendsWithUserExist(uid int64) (bool, error) | EggEnergyCommunityDividendsWithUserExist(uid int64) (bool, error) | ||||
EggEnergyCommunityDividendsWithUserDel(id interface{}) (int64, error) | |||||
} | } |
@@ -0,0 +1,8 @@ | |||||
package dao | |||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
type UserEggScoreDataDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
UserEggScoreDataInsert(data *model.UserEggScoreData) (int64, error) | |||||
} |
@@ -0,0 +1,41 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
zhios_order_relate_utils "code.fnuoos.com/EggPlanet/egg_models.git/utils" | |||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewAdminLogDb(engine *xorm.Engine) dao.AdminLogDao { | |||||
return &AdminLogDb{Db: engine} | |||||
} | |||||
type AdminLogDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func (a AdminLogDb) FindAdminLogAndTotal(page, limit, types, memo, startTime, endTime string) (*[]model.AdminLog, int64, error) { | |||||
var m []model.AdminLog | |||||
sess := a.Db.Where("1=1") | |||||
if startTime != "" { | |||||
sess.And("time>=?", startTime) | |||||
} | |||||
if endTime != "" { | |||||
sess.And("time<=?", endTime) | |||||
} | |||||
if types != "" { | |||||
sess.And("type=?", types) | |||||
} | |||||
if memo != "" { | |||||
sess.And("memo like ?", "%"+memo+"%") | |||||
} | |||||
start := (zhios_order_relate_utils.StrToInt(page) - 1) * zhios_order_relate_utils.StrToInt(limit) | |||||
count, err := sess.Limit(zhios_order_relate_utils.StrToInt(limit), start).OrderBy("id desc").FindAndCount(&m) | |||||
if err != nil { | |||||
return nil, count, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return &m, count, nil | |||||
} |
@@ -44,3 +44,11 @@ func (e EggEnergyCommunityDividendsWithUserDb) EggEnergyCommunityDividendsWithUs | |||||
} | } | ||||
return has, nil | return has, nil | ||||
} | } | ||||
func (e EggEnergyCommunityDividendsWithUserDb) EggEnergyCommunityDividendsWithUserDel(id interface{}) (int64, error) { | |||||
affected, err := e.Db.Where("id=?", id).Delete(&model.EggEnergyCommunityDividendsWithUser{}) | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err.Error()) | |||||
} | |||||
return affected, nil | |||||
} |
@@ -31,10 +31,10 @@ func (p PlatformRevenueDataDb) PlatformRevenueDataFindAndCount(page, limit int, | |||||
session = session.Where("kind = ?", kind) | session = session.Where("kind = ?", kind) | ||||
} | } | ||||
if startAt != "" { | if startAt != "" { | ||||
session = session.Where("start_at >= ?", startAt) | |||||
session = session.Where("create_at >= ?", startAt) | |||||
} | } | ||||
if endAt != "" { | if endAt != "" { | ||||
session = session.Where("end_at <= ?", endAt) | |||||
session = session.Where("create_at <= ?", endAt) | |||||
} | } | ||||
total, err := session.Limit(limit, (page-1)*limit).FindAndCount(&m) | total, err := session.Limit(limit, (page-1)*limit).FindAndCount(&m) | ||||
if err != nil { | if err != nil { | ||||
@@ -0,0 +1,23 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewUserEggScoreDataDb(engine *xorm.Engine) dao.UserEggScoreDataDao { | |||||
return &UserEggScoreDataDb{Db: engine} | |||||
} | |||||
type UserEggScoreDataDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func (u UserEggScoreDataDb) UserEggScoreDataInsert(m *model.UserEggScoreData) (int64, error) { | |||||
_, err := u.Db.InsertOne(m) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return m.Id, nil | |||||
} |
@@ -0,0 +1,15 @@ | |||||
package model | |||||
import ( | |||||
"time" | |||||
) | |||||
type AdminLog struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
Type string `json:"type" xorm:"VARCHAR(255)"` | |||||
AdminId int `json:"admin_id" xorm:"default 0 INT(11)"` | |||||
Memo string `json:"memo" xorm:"VARCHAR(2000)"` | |||||
Time time.Time `json:"time" xorm:"DATETIME"` | |||||
Ip string `json:"ip" xorm:"VARCHAR(255)"` | |||||
Data string `json:"data" xorm:"TEXT"` | |||||
} |
@@ -17,6 +17,7 @@ type FinWithdrawSetting struct { | |||||
PendingOrdersIsCanApply int `json:"pending_orders_is_can_apply" xorm:"not null comment('存在待处理记录是否允许再次申请提现(0:禁止,1:允许)') TINYINT(1)"` | PendingOrdersIsCanApply int `json:"pending_orders_is_can_apply" xorm:"not null comment('存在待处理记录是否允许再次申请提现(0:禁止,1:允许)') TINYINT(1)"` | ||||
ConditionIsOpen int `json:"condition_is_open" xorm:"not null comment('提现条件是否开启(0:关闭, 1:开启)') TINYINT(1)"` | ConditionIsOpen int `json:"condition_is_open" xorm:"not null comment('提现条件是否开启(0:关闭, 1:开启)') TINYINT(1)"` | ||||
FirstWithdrawSet string `json:"first_withdraw_set" xorm:"not null comment('首次提现设置') TEXT"` | FirstWithdrawSet string `json:"first_withdraw_set" xorm:"not null comment('首次提现设置') TEXT"` | ||||
Tips string `json:"tips" xorm:"not null comment('提示') TEXT"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') TIMESTAMP"` | CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') TIMESTAMP"` | ||||
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"` | ||||
} | } |
@@ -11,7 +11,7 @@ type User struct { | |||||
Passcode string `json:"passcode" xorm:"not null default '' comment('支付密码') CHAR(50)"` | Passcode string `json:"passcode" xorm:"not null default '' comment('支付密码') CHAR(50)"` | ||||
Level int `json:"level" xorm:"not null default 0 comment('用户等级id') INT(11)"` | Level int `json:"level" xorm:"not null default 0 comment('用户等级id') INT(11)"` | ||||
InviteTotal int `json:"invite_total" xorm:"not null default 0 comment('直推邀请总人数') INT(11)"` | InviteTotal int `json:"invite_total" xorm:"not null default 0 comment('直推邀请总人数') INT(11)"` | ||||
State int `json:"state" xorm:"not null default 1 comment('1正常,2冻结') TINYINT(1)"` | |||||
State int `json:"state" xorm:"not null default 1 comment('1正常,2冻结 3删除中 4进入回收站') TINYINT(1)"` | |||||
LastLoginIp string `json:"last_login_ip" xorm:"not null default '' comment('最后登录IP') CHAR(50)"` | LastLoginIp string `json:"last_login_ip" xorm:"not null default '' comment('最后登录IP') CHAR(50)"` | ||||
Sex int `json:"sex" xorm:"not null default 0 comment('性别(0:未知 1:男 2:女)') TINYINT(1)"` | Sex int `json:"sex" xorm:"not null default 0 comment('性别(0:未知 1:男 2:女)') TINYINT(1)"` | ||||
ParentUid int64 `json:"parent_uid" xorm:"not null default 0 comment('父级id') BIGINT(20)"` | ParentUid int64 `json:"parent_uid" xorm:"not null default 0 comment('父级id') BIGINT(20)"` | ||||
@@ -19,8 +19,9 @@ type User struct { | |||||
CustomInviteCode string `json:"custom_invite_code" xorm:"not null default '' comment('自定义邀请码') CHAR(50)"` | CustomInviteCode string `json:"custom_invite_code" xorm:"not null default '' comment('自定义邀请码') CHAR(50)"` | ||||
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | ||||
IsRealName int `json:"is_real_name" xorm:"not null default 0 comment('是否实名(0:未实名 1.已实名)') TINYINT(1)"` | IsRealName int `json:"is_real_name" xorm:"not null default 0 comment('是否实名(0:未实名 1.已实名)') TINYINT(1)"` | ||||
RegisterType int `json:"register_type" xorm:"not null comment('注册类型(1:APP注册、2:H5注册)') TINYINT(3)"` | |||||
LastLoginAt string `json:"last_login_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('上次登录时间') DATETIME"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
RegisterType int `json:"register_type" xorm:"not null default 1 comment('注册类型(1:APP注册、2:H5注册)') TINYINT(1)"` | |||||
LastLoginAt string `json:"last_login_at" xorm:"not null default CURRENT_TIMESTAMP comment('最近登录时间') DATETIME"` | |||||
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"` | |||||
RecycleParentUid int `json:"recycle_parent_uid" xorm:"default 0 comment('删除到回收站时候的上级') INT(11)"` | |||||
} | } |
@@ -0,0 +1,24 @@ | |||||
package model | |||||
type UserEggScoreData struct { | |||||
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` | |||||
Uid int64 `json:"uid" xorm:"not null comment('用户ID') BIGINT(20)"` | |||||
Ecpm string `json:"ecpm" xorm:"not null default 0.00000000 comment('ecpm') DECIMAL(20,8)"` | |||||
InviteUserNums int `json:"invite_user_nums" xorm:"not null default 0 comment('拉新人数') INT(11)"` | |||||
TeamActivityNums int `json:"team_activity_nums" xorm:"not null default 0 comment('团队活跃次数') INT(11)"` | |||||
SignInNums int `json:"sign_in_nums" xorm:"not null default 0 comment('签到次数') INT(11)"` | |||||
ImActivityNums int `json:"im_activity_nums" xorm:"not null default 0 comment('im活跃次数') INT(11)"` | |||||
SendRedPackageNums int `json:"send_red_package_nums" xorm:"not null default 0 comment('发红包次数') INT(11)"` | |||||
EggEnergyExchangeAccountBalance int `json:"egg_energy_exchange_account_balance" xorm:"not null default 0 comment('蛋蛋能量兑换余额数量') INT(11)"` | |||||
AccountBalanceExchangeEggEnergyNums int `json:"account_balance_exchange_egg_energy_nums" xorm:"not null default 0 comment('余额兑换蛋蛋能量数量') INT(11)"` | |||||
SendCircleOfFriendNums int `json:"send_circle_of_friend_nums" xorm:"not null default 0 comment('发朋友圈次数') INT(11)"` | |||||
ForumCommentsNums int `json:"forum_comments_nums" xorm:"not null default 0 comment('论坛评论次数') INT(11)"` | |||||
CollegeLearningNums int `json:"college_learning_nums" xorm:"not null default 0 comment('学院学习次数') INT(11)"` | |||||
ViolateNums int `json:"violate_nums" xorm:"not null default 0 comment('违规次数') INT(11)"` | |||||
BrowseInterfaceNums int `json:"browse_interface_nums" xorm:"not null default 0 comment('浏览界面次数') INT(11)"` | |||||
PersonAddActivityValue int `json:"person_add_activity_value" xorm:"not null default 0 comment('个人活跃积分') INT(11)"` | |||||
Score string `json:"score" xorm:"not null comment('分数') DECIMAL(20,8)"` | |||||
Date string `json:"date" xorm:"not null default '0000-00' comment('日期(YYYY-WW)') CHAR(50)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |