@@ -0,0 +1,5 @@ | |||||
package dao | |||||
type InstallmentPaymentListDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
} |
@@ -0,0 +1,5 @@ | |||||
package dao | |||||
type InstallmentPaymentSchemeDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
} |
@@ -0,0 +1,5 @@ | |||||
package dao | |||||
type InstallmentPaymentSchemeWithGoodsDao interface { | |||||
//TODO:: You can add specific method definitions here | |||||
} |
@@ -1,10 +1,13 @@ | |||||
package dao | package dao | ||||
import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
"xorm.io/xorm" | |||||
) | |||||
type SuperCloudIssuanceUserRobotDao interface { | type SuperCloudIssuanceUserRobotDao interface { | ||||
GetSuperCloudIssuanceUserRobot() (m *models.SuperCloudIssuanceUserRobot, err error) | GetSuperCloudIssuanceUserRobot() (m *models.SuperCloudIssuanceUserRobot, err error) | ||||
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) (id int, err error) | |||||
InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) | |||||
} | } |
@@ -0,0 +1,14 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | |||||
"xorm.io/xorm" | |||||
) | |||||
type InstallmentPaymentListDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func NewInstallmentPaymentListDb(engine *xorm.Engine) dao.InstallmentPaymentListDao { | |||||
return &InstallmentPaymentListDb{Db: engine} | |||||
} |
@@ -0,0 +1,14 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | |||||
"xorm.io/xorm" | |||||
) | |||||
type InstallmentPaymentSchemeDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func NewInstallmentPaymentSchemeDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeDao { | |||||
return &InstallmentPaymentSchemeDb{Db: engine} | |||||
} |
@@ -0,0 +1,14 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | |||||
"xorm.io/xorm" | |||||
) | |||||
type InstallmentPaymentSchemeWithGoodsDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func NewInstallmentPaymentSchemeWithGoodsDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeWithGoodsDao { | |||||
return &InstallmentPaymentSchemeWithGoodsDb{Db: engine} | |||||
} |
@@ -3,6 +3,8 @@ package implement | |||||
import ( | import ( | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | ||||
db "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/super_cloud_issuance/enum" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/super_cloud_issuance/enum" | ||||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | ||||
"strconv" | "strconv" | ||||
@@ -24,17 +26,17 @@ type SuperCloudIssuanceUserRobotDb struct { | |||||
MasterId string `json:"master_id"` | MasterId string `json:"master_id"` | ||||
} | } | ||||
func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot) (id int, err error) { | |||||
_, err = cloudIssuanceUserRobotDb.Db.InsertOne(m) | |||||
func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) { | |||||
_, err = superCloudIssuanceUserRobotDb.Db.InsertOne(m) | |||||
if err != nil { | if err != nil { | ||||
return 0, err | return 0, err | ||||
} | } | ||||
id = m.Id | id = m.Id | ||||
//顺便新增一份数据到总后台的 `cloud_issuance_robot_records` 表 | |||||
db.CloudIssuanceRobotRecordsInsert(&model2.CloudIssuanceRobotRecords{ | |||||
MasterId: cloudIssuanceUserRobotDb.MasterId, | |||||
//顺便新增一份数据到总后台的 `super_cloud_issuance_robot_records` 表 | |||||
db.CloudIssuanceRobotRecordsInsert(officialDb, &model.SuperCloudIssuanceRobotRecords{ | |||||
MasterId: superCloudIssuanceUserRobotDb.MasterId, | |||||
RobotId: strconv.Itoa(m.RobotId), | RobotId: strconv.Itoa(m.RobotId), | ||||
Uid: cloudIssuanceUserRobotDb.Uid, | |||||
Uid: superCloudIssuanceUserRobotDb.Uid, | |||||
}) | }) | ||||
return id, nil | return id, nil | ||||
} | } | ||||
@@ -0,0 +1,15 @@ | |||||
package models | |||||
type InstallmentPaymentList struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"` | |||||
GoodsId int `json:"goods_id" xorm:"not null default 0 comment('商品ID') INT(11)"` | |||||
OrdId int64 `json:"ord_id" xorm:"not null default 0 comment('订单ID') BIGINT(20)"` | |||||
TotalAmount string `json:"total_amount" xorm:"not null default 0.00 comment('总金额') DECIMAL(12,2)"` | |||||
InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` | |||||
AlreadyRepaidInstallmentNums int `json:"already_repaid_installment_nums" xorm:"not null default 0 comment('已换分期数') TINYINT(3)"` | |||||
RepaymentAmountPerInstallment string `json:"repayment_amount_per_installment" xorm:"not null default 0.00 comment('每期还款金额') DECIMAL(12,2)"` | |||||
IsRepaidOff int `json:"is_repaid_off" xorm:"not null default 0 comment('是否已偿还完(0:未偿还完 1:已偿还完)') TINYINT(1)"` | |||||
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,9 @@ | |||||
package models | |||||
type InstallmentPaymentScheme struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
Name string `json:"name" xorm:"not null default '' comment('方案名称') CHAR(50)"` | |||||
InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` | |||||
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,10 @@ | |||||
package models | |||||
type InstallmentPaymentSchemeWithGoods struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
GoodsId int `json:"goods_id" xorm:"not null default 0 comment('商品id') INT(11)"` | |||||
SchemeId int `json:"scheme_id" xorm:"not null default 0 comment('方案id') INT(11)"` | |||||
Pvd int `json:"pvd" xorm:"not null default 1 comment('平台(1:自营商城)') TINYINT(3)"` | |||||
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,15 @@ | |||||
package db | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" | |||||
"xorm.io/xorm" | |||||
) | |||||
// CloudIssuanceRobotRecordsInsert 插入单条数据 | |||||
func CloudIssuanceRobotRecordsInsert(officialDb *xorm.Engine, CloudIssuanceRobotRecords *model.SuperCloudIssuanceRobotRecords) (int, error) { | |||||
_, err := officialDb.InsertOne(CloudIssuanceRobotRecords) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return CloudIssuanceRobotRecords.Id, nil | |||||
} |
@@ -0,0 +1,15 @@ | |||||
package model | |||||
import "time" | |||||
type SuperCloudIssuanceBasic struct { | |||||
Id int `json:"id"` | |||||
ImageNumsLimitIssuanceOnCircleOfFriends int `json:"image_nums_limit_issuance_on_circle_of_friends"` | |||||
ImageNumsLimitIssuanceOnGroups int `json:"image_nums_limit_issuance_on_groups"` | |||||
BindNums int `json:"bind_nums"` | |||||
FollowGroupUserNums int `json:"follow_group_user_nums"` | |||||
FollowGroupBindNums int `json:"follow_group_bind_nums"` | |||||
FollowGroupRelayNums int `json:"follow_group_relay_nums"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` | |||||
} |
@@ -0,0 +1,14 @@ | |||||
package model | |||||
import "time" | |||||
type SuperCloudIssuanceMaster struct { | |||||
Id int `json:"id"` | |||||
MasterId int `json:"master_id"` | |||||
Amount string `json:"amount"` | |||||
CreditAmount string `json:"credit_amount"` | |||||
Memo string `json:"memo"` | |||||
State int `json:"state"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` | |||||
} |
@@ -0,0 +1,22 @@ | |||||
package model | |||||
import "time" | |||||
type SuperCloudIssuanceMasterBuyOrd struct { | |||||
Id int `json:"id"` | |||||
OrdId string `json:"ord_id"` | |||||
MasterId int `json:"master_id"` | |||||
Nickname string `json:"nickname"` | |||||
Phone int64 `json:"phone"` | |||||
Uid int `json:"uid"` | |||||
UserPhone string `json:"user_phone"` | |||||
RobotId int `json:"robot_id"` | |||||
Month int `json:"month"` | |||||
CostPrice string `json:"cost_price"` | |||||
BeforeBalance string `json:"before_balance"` | |||||
Balance string `json:"balance"` | |||||
Memo string `json:"memo"` | |||||
State int `json:"state"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` | |||||
} |
@@ -0,0 +1,15 @@ | |||||
package model | |||||
import "time" | |||||
type SuperCloudIssuanceRobot struct { | |||||
Id int `json:"id"` | |||||
Name string `json:"name"` | |||||
Price string `json:"price"` | |||||
Type int32 `json:"type"` | |||||
State int32 `json:"state"` | |||||
Sort int `json:"sort"` | |||||
Memo string `json:"memo"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` | |||||
} |
@@ -0,0 +1,8 @@ | |||||
package model | |||||
type SuperCloudIssuanceRobotRecords struct { | |||||
Id int `json:"id"` | |||||
MasterId string `json:"master_id"` | |||||
RobotId string `json:"robot_id"` | |||||
Uid int `json:"uid"` | |||||
} |
@@ -0,0 +1,8 @@ | |||||
package model | |||||
type UserAppList struct { | |||||
Id int `json:"id" xorm:"int(11) NOT NULL "` | |||||
Uuid int64 `json:"uuid" xorm:"int(10) NOT NULL "` | |||||
AppId int64 `json:"app_id" xorm:"int(10) NOT NULL "` | |||||
Name string `json:"name" xorm:"varchar(255) DEFAULT '' "` | |||||
} |
@@ -0,0 +1,8 @@ | |||||
package model | |||||
type UserAppMember struct { | |||||
Id int `json:"id" xorm:"int(11) NOT NULL "` | |||||
Uuid int64 `json:"uuid" xorm:"int(10) NOT NULL "` | |||||
Uid int64 `json:"uid" xorm:"int(10) NOT NULL "` | |||||
Phone int64 `json:"phone" xorm:"int(10) NOT NULL "` | |||||
} |