@@ -1,9 +1,13 @@ | |||||
package dao | package dao | ||||
import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
type AgentListDao interface { | type AgentListDao interface { | ||||
GetAgentList(agentId int) (medium *model.AgentList, err error) | |||||
GetAgentList(agentId int) (agent *model.AgentList, err error) | |||||
GetAgentListBySession(session *xorm.Session, agentId int) (agent *model.AgentList, err error) | |||||
AgentListInsert(m *model.AgentList) (int64, error) | AgentListInsert(m *model.AgentList) (int64, error) | ||||
UpdateAgentList(m *model.AgentList, columns ...string) (int64, error) | UpdateAgentList(m *model.AgentList, columns ...string) (int64, error) | ||||
FindAgentList(uuid, name, state string, minState, page, limit int) (list []model.AgentList, total int64, err error) | FindAgentList(uuid, name, state string, minState, page, limit int) (list []model.AgentList, total int64, err error) | ||||
@@ -1,5 +1,12 @@ | |||||
package dao | package dao | ||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
type AgentSettlementDao interface { | type AgentSettlementDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
GetAgentSettlementForAvailable(agentId int) (agentSettlement *model.AgentSettlement, err error) | |||||
AgentSettlementInsertBySession(session *xorm.Session, m *model.AgentSettlement) (int64, error) | |||||
UpdateAgentSettlementBySession(session *xorm.Session, agentSettlement *model.AgentSettlement, columns ...string) (int64, error) | |||||
} | } |
@@ -1,5 +1,10 @@ | |||||
package dao | package dao | ||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
type AgentSettlementWithFlowDao interface { | type AgentSettlementWithFlowDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
AgentSettlementWithFlowInsertBySession(session *xorm.Session, agentSettlementWithFlow *model.AgentSettlementWithFlow) (int64, error) | |||||
} | } |
@@ -0,0 +1,5 @@ | |||||
package dao | |||||
type FinAgentFlowDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
} |
@@ -0,0 +1,5 @@ | |||||
package dao | |||||
type FinMediumFlowDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
} |
@@ -7,4 +7,6 @@ import ( | |||||
type GenerateWxAdDataDao interface { | type GenerateWxAdDataDao interface { | ||||
GenerateWxAdDataInsertBySession(session *xorm.Session, m *model.GenerateWxAdData) (int64, error) | GenerateWxAdDataInsertBySession(session *xorm.Session, m *model.GenerateWxAdData) (int64, error) | ||||
GetGenerateWxAdData(id int) (data *model.GenerateWxAdData, err error) | |||||
UpdateGenerateWxAdDataBySession(session *xorm.Session, m *model.GenerateWxAdData, columns ...string) (int64, error) | |||||
} | } |
@@ -1,9 +1,13 @@ | |||||
package dao | package dao | ||||
import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
type MediumListDao interface { | type MediumListDao interface { | ||||
GetMediumList(mediumId int) (medium *model.MediumList, err error) | GetMediumList(mediumId int) (medium *model.MediumList, err error) | ||||
GetMediumListBySession(session *xorm.Session, mediumId int) (medium *model.MediumList, err error) | |||||
MediumListInsert(m *model.MediumList) (int64, error) | MediumListInsert(m *model.MediumList) (int64, error) | ||||
UpdateMediumList(m *model.MediumList, columns ...string) (int64, error) | UpdateMediumList(m *model.MediumList, columns ...string) (int64, error) | ||||
FindMediumList(uuid, name, state string, minState, page, limit int) (list []model.MediumList, total int64, err error) | FindMediumList(uuid, name, state string, minState, page, limit int) (list []model.MediumList, total int64, err error) | ||||
@@ -1,5 +1,12 @@ | |||||
package dao | package dao | ||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
type MediumSettlementDao interface { | type MediumSettlementDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
GetMediumSettlementForAvailable(mediumId int) (mediumSettlement *model.MediumSettlement, err error) | |||||
MediumSettlementInsertBySession(session *xorm.Session, m *model.MediumSettlement) (int64, error) | |||||
UpdateMediumSettlementBySession(session *xorm.Session, mediumSettlement *model.MediumSettlement, columns ...string) (int64, error) | |||||
} | } |
@@ -1,5 +1,10 @@ | |||||
package dao | package dao | ||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
type MediumSettlementWithFlowDao interface { | type MediumSettlementWithFlowDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
MediumSettlementWithFlowInsertBySession(session *xorm.Session, mediumSettlementWithFlow *model.MediumSettlementWithFlow) (int64, error) | |||||
} | } |
@@ -15,16 +15,25 @@ type AgentListDb struct { | |||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (a AgentListDb) GetAgentList(agentId int) (medium *model.AgentList, err error) { | |||||
medium = new(model.AgentList) | |||||
has, err := a.Db.Where("agent_id =?", agentId).Get(medium) | |||||
func (a AgentListDb) GetAgentListBySession(session *xorm.Session, agentId int) (agent *model.AgentList, err error) { | |||||
var mm model.AgentList | |||||
if has, err := session.Where("agent_id = ?", agentId). | |||||
Get(&mm); err != nil || has == false { | |||||
return nil, zhios_order_relate_logx.Warn(err) | |||||
} | |||||
return &mm, nil | |||||
} | |||||
func (a AgentListDb) GetAgentList(agentId int) (agent *model.AgentList, err error) { | |||||
agent = new(model.AgentList) | |||||
has, err := a.Db.Where("agent_id =?", agentId).Get(agent) | |||||
if err != nil { | if err != nil { | ||||
return nil, zhios_order_relate_logx.Error(err) | return nil, zhios_order_relate_logx.Error(err) | ||||
} | } | ||||
if has == false { | if has == false { | ||||
return nil, nil | return nil, nil | ||||
} | } | ||||
return medium, nil | |||||
return agent, nil | |||||
} | } | ||||
func (a AgentListDb) AgentListInsert(m *model.AgentList) (int64, error) { | func (a AgentListDb) AgentListInsert(m *model.AgentList) (int64, error) { | ||||
@@ -2,6 +2,8 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -12,3 +14,31 @@ func NewAgentSettlementDb(engine *xorm.Engine) dao.AgentSettlementDao { | |||||
type AgentSettlementDb struct { | type AgentSettlementDb struct { | ||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (a AgentSettlementDb) UpdateAgentSettlementBySession(session *xorm.Session, agentSettlement *model.AgentSettlement, columns ...string) (int64, error) { | |||||
affected, err := session.Where("id =?", agentSettlement.Id).Cols(columns...).Update(agentSettlement) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return affected, nil | |||||
} | |||||
func (a AgentSettlementDb) GetAgentSettlementForAvailable(agentId int) (agentSettlement *model.AgentSettlement, err error) { | |||||
agentSettlement = new(model.AgentSettlement) | |||||
has, err := a.Db.Where("agent_id =?", agentId).And("state =?", 0).Get(agentSettlement) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return agentSettlement, nil | |||||
} | |||||
func (a AgentSettlementDb) AgentSettlementInsertBySession(session *xorm.Session, m *model.AgentSettlement) (int64, error) { | |||||
insertAffected, err := session.InsertOne(m) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return insertAffected, nil | |||||
} |
@@ -2,6 +2,7 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -12,3 +13,11 @@ func NewAgentSettlementWithFlowDb(engine *xorm.Engine) dao.AgentSettlementWithFl | |||||
type AgentSettlementWithFlowDb struct { | type AgentSettlementWithFlowDb struct { | ||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (a AgentSettlementWithFlowDb) AgentSettlementWithFlowInsertBySession(session *xorm.Session, agentSettlementWithFlow *model.AgentSettlementWithFlow) (int64, error) { | |||||
insertAffected, err := session.InsertOne(agentSettlementWithFlow) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return insertAffected, nil | |||||
} |
@@ -0,0 +1,14 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewFinAgentFlowDb(engine *xorm.Engine) dao.FinAgentFlowDao { | |||||
return &FinAgentFlowDb{Db: engine} | |||||
} | |||||
type FinAgentFlowDb struct { | |||||
Db *xorm.Engine | |||||
} |
@@ -0,0 +1,14 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewFinMediumFlowDb(engine *xorm.Engine) dao.FinMediumFlowDao { | |||||
return &FinMediumFlowDb{Db: engine} | |||||
} | |||||
type FinMediumFlowDb struct { | |||||
Db *xorm.Engine | |||||
} |
@@ -3,6 +3,7 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | "code.fnuoos.com/zhimeng/model.git/src/super/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -14,6 +15,26 @@ type GenerateWxAdDataDb struct { | |||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (g GenerateWxAdDataDb) UpdateGenerateWxAdDataBySession(session *xorm.Session, m *model.GenerateWxAdData, columns ...string) (int64, error) { | |||||
affected, err := session.Where("id =?", m.Id).Cols(columns...).Update(m) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return affected, nil | |||||
} | |||||
func (g GenerateWxAdDataDb) GetGenerateWxAdData(id int) (data *model.GenerateWxAdData, err error) { | |||||
data = new(model.GenerateWxAdData) | |||||
has, err := g.Db.Where("id =?", id).Get(data) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return data, nil | |||||
} | |||||
func (g GenerateWxAdDataDb) GenerateWxAdDataInsertBySession(session *xorm.Session, m *model.GenerateWxAdData) (int64, error) { | func (g GenerateWxAdDataDb) GenerateWxAdDataInsertBySession(session *xorm.Session, m *model.GenerateWxAdData) (int64, error) { | ||||
insertAffected, err := session.InsertOne(m) | insertAffected, err := session.InsertOne(m) | ||||
if err != nil { | if err != nil { | ||||
@@ -15,6 +15,15 @@ type MediumListDb struct { | |||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (m MediumListDb) GetMediumListBySession(session *xorm.Session, mediumId int) (medium *model.MediumList, err error) { | |||||
var mm model.MediumList | |||||
if has, err := session.Where("medium_id = ?", mediumId). | |||||
Get(&mm); err != nil || has == false { | |||||
return nil, zhios_order_relate_logx.Warn(err) | |||||
} | |||||
return &mm, nil | |||||
} | |||||
func (m MediumListDb) GetMediumList(mediumId int) (medium *model.MediumList, err error) { | func (m MediumListDb) GetMediumList(mediumId int) (medium *model.MediumList, err error) { | ||||
medium = new(model.MediumList) | medium = new(model.MediumList) | ||||
has, err := m.Db.Where("medium_id =?", mediumId).Get(medium) | has, err := m.Db.Where("medium_id =?", mediumId).Get(medium) | ||||
@@ -2,6 +2,8 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -12,3 +14,31 @@ func NewMediumSettlementDb(engine *xorm.Engine) dao.MediumSettlementDao { | |||||
type MediumSettlementDb struct { | type MediumSettlementDb struct { | ||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (m MediumSettlementDb) UpdateMediumSettlementBySession(session *xorm.Session, mediumSettlement *model.MediumSettlement, columns ...string) (int64, error) { | |||||
affected, err := session.Where("id =?", mediumSettlement.Id).Cols(columns...).Update(m) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return affected, nil | |||||
} | |||||
func (m MediumSettlementDb) MediumSettlementInsertBySession(session *xorm.Session, mediumSettlement *model.MediumSettlement) (int64, error) { | |||||
insertAffected, err := session.InsertOne(mediumSettlement) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return insertAffected, nil | |||||
} | |||||
func (m MediumSettlementDb) GetMediumSettlementForAvailable(mediumId int) (mediumSettlement *model.MediumSettlement, err error) { | |||||
mediumSettlement = new(model.MediumSettlement) | |||||
has, err := m.Db.Where("medium_id =?", mediumId).And("state =?", 0).Get(mediumSettlement) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return mediumSettlement, nil | |||||
} |
@@ -2,6 +2,7 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -12,3 +13,11 @@ func NewMediumSettlementWithFlowDb(engine *xorm.Engine) dao.MediumSettlementWith | |||||
type MediumSettlementWithFlowDb struct { | type MediumSettlementWithFlowDb struct { | ||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (m MediumSettlementWithFlowDb) MediumSettlementWithFlowInsertBySession(session *xorm.Session, mediumSettlementWithFlow *model.MediumSettlementWithFlow) (int64, error) { | |||||
insertAffected, err := session.InsertOne(m) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return insertAffected, nil | |||||
} |
@@ -4,6 +4,7 @@ type AgentList struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | ||||
Uuid int `json:"uuid" xorm:"not null comment('站长id') index unique(IDX_UUID_TYPE) INT(11)"` | Uuid int `json:"uuid" xorm:"not null comment('站长id') index unique(IDX_UUID_TYPE) INT(11)"` | ||||
AgentId int `json:"agent_id" xorm:"not null comment('代理id') unique(IDX_UUID_TYPE) INT(11)"` | AgentId int `json:"agent_id" xorm:"not null comment('代理id') unique(IDX_UUID_TYPE) INT(11)"` | ||||
Amount string `json:"amount" xorm:"not null default 0.00 comment('余额') DECIMAL(8,2)"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('类型(1:企业 2:个人)') TINYINT(1)"` | Kind int `json:"kind" xorm:"not null default 1 comment('类型(1:企业 2:个人)') TINYINT(1)"` | ||||
CompanyName string `json:"company_name" xorm:"not null default '' comment('公司名称') VARCHAR(255)"` | CompanyName string `json:"company_name" xorm:"not null default '' comment('公司名称') VARCHAR(255)"` | ||||
CompanyAbbreviation string `json:"company_abbreviation" xorm:"not null default '' comment('公司简称') VARCHAR(255)"` | CompanyAbbreviation string `json:"company_abbreviation" xorm:"not null default '' comment('公司简称') VARCHAR(255)"` | ||||
@@ -22,6 +23,7 @@ type AgentList struct { | |||||
BusinessLicenseAddress string `json:"business_license_address" xorm:"not null default '' comment('营业执照地址') VARCHAR(255)"` | BusinessLicenseAddress string `json:"business_license_address" xorm:"not null default '' comment('营业执照地址') VARCHAR(255)"` | ||||
CertificateValidity string `json:"certificate_validity" xorm:"not null default '0000-00-00' comment('证件有效期') CHAR(50)"` | CertificateValidity string `json:"certificate_validity" xorm:"not null default '0000-00-00' comment('证件有效期') CHAR(50)"` | ||||
State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝)') TINYINT(1)"` | State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝)') TINYINT(1)"` | ||||
SettlementType int `json:"settlement_type" xorm:"not null default 1 comment('结算方式(1:日结 2:周结 3:月结 4:预付)') TINYINT(1)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' 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"` | UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"` | Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"` | ||||
@@ -10,8 +10,8 @@ type AgentSettlement struct { | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('结算单类型(1:日结 2:周结 3:月结 4:预付)') TINYINT(1)"` | Kind int `json:"kind" xorm:"not null default 1 comment('结算单类型(1:日结 2:周结 3:月结 4:预付)') TINYINT(1)"` | ||||
BasicIncome int `json:"basic_income" xorm:"not null default 0 comment('基础收益(分)') INT(11)"` | BasicIncome int `json:"basic_income" xorm:"not null default 0 comment('基础收益(分)') INT(11)"` | ||||
OtherIncome int `json:"other_income" xorm:"not null default 0 comment('其他收益(分)') INT(11)"` | OtherIncome int `json:"other_income" xorm:"not null default 0 comment('其他收益(分)') INT(11)"` | ||||
State int `json:"state" xorm:"not null default 0 comment('结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)') TINYINT(1)"` | |||||
PayState int `json:"pay_state" xorm:"not null default 0 comment('结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)') TINYINT(1)"` | |||||
PayState int `json:"pay_state" xorm:"not null default 0 comment('结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)') TINYINT(1)"` | |||||
State int `json:"state" xorm:"not null default 0 comment('结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)') TINYINT(1)"` | |||||
StartDate string `json:"start_date" xorm:"not null default '0000-00-00' comment('开始时间') CHAR(50)"` | StartDate string `json:"start_date" xorm:"not null default '0000-00-00' comment('开始时间') CHAR(50)"` | ||||
EndDate string `json:"end_date" xorm:"not null default '0000-00-00' comment('结束时间') CHAR(50)"` | EndDate string `json:"end_date" xorm:"not null default '0000-00-00' comment('结束时间') CHAR(50)"` | ||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
@@ -3,6 +3,7 @@ package model | |||||
type AgentSettlementWithFlow struct { | type AgentSettlementWithFlow struct { | ||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | ||||
SettlementId int `json:"settlement_id" xorm:"not null default 0 comment('结算id') index unique(IDX_UUID_TYPE) INT(11)"` | SettlementId int `json:"settlement_id" xorm:"not null default 0 comment('结算id') index unique(IDX_UUID_TYPE) INT(11)"` | ||||
GenerateDataId int `json:"generate_data_id" xorm:"not null default 0 comment('生成数据id') INT(11)"` | |||||
Amount int `json:"amount" xorm:"not null default 0 comment('变动金额(分)') unique(IDX_UUID_TYPE) INT(11)"` | Amount int `json:"amount" xorm:"not null default 0 comment('变动金额(分)') unique(IDX_UUID_TYPE) INT(11)"` | ||||
BasicIncomeBefore int `json:"basic_income_before" xorm:"not null default 0 comment('基础收益(分)-变更前') INT(11)"` | BasicIncomeBefore int `json:"basic_income_before" xorm:"not null default 0 comment('基础收益(分)-变更前') INT(11)"` | ||||
BasicIncomeAfter int `json:"basic_income_after" xorm:"not null default 0 comment('基础收益(分)-变更后') INT(11)"` | BasicIncomeAfter int `json:"basic_income_after" xorm:"not null default 0 comment('基础收益(分)-变更后') INT(11)"` | ||||
@@ -0,0 +1,15 @@ | |||||
package model | |||||
type FinAgentFlow struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
AgentId int `json:"agent_id" xorm:"not null default 0 comment('代理id') INT(11)"` | |||||
Type int `json:"type" xorm:"not null default 1 comment('1收入,2支出') TINYINT(1)"` | |||||
Amount string `json:"amount" xorm:"not null default 0.00 comment('变动金额') DECIMAL(8,2)"` | |||||
BeforeAmount string `json:"before_amount" xorm:"not null default 0.00 comment('变动前金额') DECIMAL(8,2)"` | |||||
AfterAmount string `json:"after_amount" xorm:"not null default 0.00 comment('变动后金额') DECIMAL(8,2)"` | |||||
OrdId string `json:"ord_id" xorm:"not null default '' comment('对应订单id') VARCHAR(50)"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('类型(1:管理员修改增加 2:管理员修改减少 3:结算款扣除)') TINYINT(4)"` | |||||
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |
@@ -0,0 +1,15 @@ | |||||
package model | |||||
type FinMediumFlow struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
MediumId int `json:"medium_id" xorm:"not null default 0 comment('媒体id') INT(11)"` | |||||
Type int `json:"type" xorm:"not null default 1 comment('1收入,2支出') TINYINT(1)"` | |||||
Amount string `json:"amount" xorm:"not null default 0.00 comment('变动金额') DECIMAL(8,2)"` | |||||
BeforeAmount string `json:"before_amount" xorm:"not null default 0.00 comment('变动前金额') DECIMAL(8,2)"` | |||||
AfterAmount string `json:"after_amount" xorm:"not null default 0.00 comment('变动后金额') DECIMAL(8,2)"` | |||||
OrdId string `json:"ord_id" xorm:"not null default '' comment('对应订单id') VARCHAR(50)"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('类型(1:管理员修改增加 2:管理员修改减少 3:结算款扣除)') TINYINT(4)"` | |||||
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} |
@@ -4,7 +4,7 @@ type GenerateWxAdData struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | ||||
Uuid int `json:"uuid" xorm:"not null comment('站长id') index INT(10)"` | Uuid int `json:"uuid" xorm:"not null comment('站长id') index INT(10)"` | ||||
AppId string `json:"app_id" xorm:"not null default '' comment('小程序id') VARCHAR(255)"` | AppId string `json:"app_id" xorm:"not null default '' comment('小程序id') VARCHAR(255)"` | ||||
GenerateDataId int `json:"generate_data_id" xorm:"not null default 0 comment('原始数据id') INT(11)"` | |||||
OriginalDataId int `json:"original_data_id" xorm:"not null default 0 comment('原始数据id') INT(11)"` | |||||
SlotId string `json:"slot_id" xorm:"not null default '' comment('广告位id') index unique(SLOT_ID_UNIQUE) VARCHAR(255)"` | SlotId string `json:"slot_id" xorm:"not null default '' comment('广告位id') index unique(SLOT_ID_UNIQUE) VARCHAR(255)"` | ||||
AdSlot string `json:"ad_slot" xorm:"not null default '' comment('广告位类型') CHAR(50)"` | AdSlot string `json:"ad_slot" xorm:"not null default '' comment('广告位类型') CHAR(50)"` | ||||
Date string `json:"date" xorm:"not null default '' comment('日期') unique(SLOT_ID_UNIQUE) CHAR(50)"` | Date string `json:"date" xorm:"not null default '' comment('日期') unique(SLOT_ID_UNIQUE) CHAR(50)"` | ||||
@@ -4,6 +4,7 @@ type MediumList struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | ||||
Uuid int `json:"uuid" xorm:"not null comment('站长id') index unique(IDX_UUID_TYPE) INT(11)"` | Uuid int `json:"uuid" xorm:"not null comment('站长id') index unique(IDX_UUID_TYPE) INT(11)"` | ||||
MediumId int `json:"medium_id" xorm:"not null comment('媒体id') unique(IDX_UUID_TYPE) INT(11)"` | MediumId int `json:"medium_id" xorm:"not null comment('媒体id') unique(IDX_UUID_TYPE) INT(11)"` | ||||
Amount string `json:"amount" xorm:"not null default 0.00 comment('余额') DECIMAL(8,2)"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('类型(1:企业 2:个人)') TINYINT(1)"` | Kind int `json:"kind" xorm:"not null default 1 comment('类型(1:企业 2:个人)') TINYINT(1)"` | ||||
CompanyName string `json:"company_name" xorm:"not null default '' comment('公司名称') VARCHAR(255)"` | CompanyName string `json:"company_name" xorm:"not null default '' comment('公司名称') VARCHAR(255)"` | ||||
CompanyAbbreviation string `json:"company_abbreviation" xorm:"not null default '' comment('公司简称') VARCHAR(255)"` | CompanyAbbreviation string `json:"company_abbreviation" xorm:"not null default '' comment('公司简称') VARCHAR(255)"` | ||||
@@ -22,7 +23,8 @@ type MediumList struct { | |||||
BusinessLicenseAddress string `json:"business_license_address" xorm:"not null default '' comment('营业执照地址') VARCHAR(255)"` | BusinessLicenseAddress string `json:"business_license_address" xorm:"not null default '' comment('营业执照地址') VARCHAR(255)"` | ||||
CertificateValidity string `json:"certificate_validity" xorm:"not null default '0000-00-00' comment('证件有效期') CHAR(50)"` | CertificateValidity string `json:"certificate_validity" xorm:"not null default '0000-00-00' comment('证件有效期') CHAR(50)"` | ||||
State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝)') TINYINT(1)"` | State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝)') TINYINT(1)"` | ||||
SettlementType int `json:"settlement_type" xorm:"not null default 1 comment('结算方式(1:日结 2:周结 3:月结 4:预付)') TINYINT(1)"` | |||||
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' 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"` | UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"` | |||||
} | } |
@@ -9,8 +9,8 @@ type MediumSettlement struct { | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('结算单类型(1:日结 2:周结 3:月结 4:预付)') TINYINT(1)"` | Kind int `json:"kind" xorm:"not null default 1 comment('结算单类型(1:日结 2:周结 3:月结 4:预付)') TINYINT(1)"` | ||||
BasicIncome int `json:"basic_income" xorm:"not null default 0 comment('基础收益(分)') INT(11)"` | BasicIncome int `json:"basic_income" xorm:"not null default 0 comment('基础收益(分)') INT(11)"` | ||||
OtherIncome int `json:"other_income" xorm:"not null default 0 comment('其他收益(分)') INT(11)"` | OtherIncome int `json:"other_income" xorm:"not null default 0 comment('其他收益(分)') INT(11)"` | ||||
State int `json:"state" xorm:"not null default 0 comment('结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)') TINYINT(1)"` | |||||
PayState int `json:"pay_state" xorm:"not null default 0 comment('结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)') TINYINT(1)"` | |||||
PayState int `json:"pay_state" xorm:"not null default 0 comment('结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)') TINYINT(1)"` | |||||
State int `json:"state" xorm:"not null default 0 comment('结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)') TINYINT(1)"` | |||||
StartDate string `json:"start_date" xorm:"not null default '0000-00-00' comment('开始时间') CHAR(50)"` | StartDate string `json:"start_date" xorm:"not null default '0000-00-00' comment('开始时间') CHAR(50)"` | ||||
EndDate string `json:"end_date" xorm:"not null default '0000-00-00' comment('结束时间') CHAR(50)"` | EndDate string `json:"end_date" xorm:"not null default '0000-00-00' comment('结束时间') CHAR(50)"` | ||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
@@ -3,6 +3,7 @@ package model | |||||
type MediumSettlementWithFlow struct { | type MediumSettlementWithFlow struct { | ||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | ||||
SettlementId int `json:"settlement_id" xorm:"not null default 0 comment('结算id') index unique(IDX_UUID_TYPE) INT(11)"` | SettlementId int `json:"settlement_id" xorm:"not null default 0 comment('结算id') index unique(IDX_UUID_TYPE) INT(11)"` | ||||
GenerateDataId int `json:"generate_data_id" xorm:"not null default 0 comment('生成数据id') INT(11)"` | |||||
Amount int `json:"amount" xorm:"not null default 0 comment('变动金额(分)') unique(IDX_UUID_TYPE) INT(11)"` | Amount int `json:"amount" xorm:"not null default 0 comment('变动金额(分)') unique(IDX_UUID_TYPE) INT(11)"` | ||||
BasicIncomeBefore int `json:"basic_income_before" xorm:"not null default 0 comment('基础收益(分)-变更前') INT(11)"` | BasicIncomeBefore int `json:"basic_income_before" xorm:"not null default 0 comment('基础收益(分)-变更前') INT(11)"` | ||||
BasicIncomeAfter int `json:"basic_income_after" xorm:"not null default 0 comment('基础收益(分)-变更后') INT(11)"` | BasicIncomeAfter int `json:"basic_income_after" xorm:"not null default 0 comment('基础收益(分)-变更后') INT(11)"` | ||||