@@ -0,0 +1,44 @@ | |||
package db | |||
import ( | |||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" | |||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | |||
"xorm.io/xorm" | |||
) | |||
// MasterB2cOrderStatisticsInsert 插入单条数据 | |||
func MasterB2cOrderStatisticsInsert(officialDb *xorm.Engine, MasterB2cOrderStatistics *model.MasterB2cOrderStatistics) (int, error) { | |||
_, err := officialDb.InsertOne(MasterB2cOrderStatistics) | |||
if err != nil { | |||
return 0, err | |||
} | |||
return MasterB2cOrderStatistics.Id, nil | |||
} | |||
func GetMasterB2cOrderStatistics(officialDb *xorm.Engine, masterId int, date string) (m *model.MasterB2cOrderStatistics, err error) { | |||
m = new(model.MasterB2cOrderStatistics) | |||
has, err := officialDb.Where("master_id =?", masterId).And("date =?", date).Get(m) | |||
if err != nil { | |||
return nil, zhios_order_relate_logx.Error(err) | |||
} | |||
if has == false { | |||
return nil, nil | |||
} | |||
return m, nil | |||
} | |||
func MasterB2cOrderStatisticsUpdate(officialDb *xorm.Engine, id interface{}, m *model.MasterB2cOrderStatistics, forceColums ...string) (int64, error) { | |||
var ( | |||
affected int64 | |||
err error | |||
) | |||
if forceColums != nil { | |||
affected, err = officialDb.Where("id=?", id).Cols(forceColums...).Update(m) | |||
} else { | |||
affected, err = officialDb.Where("id=?", id).Update(m) | |||
} | |||
if err != nil { | |||
return 0, err | |||
} | |||
return affected, nil | |||
} |
@@ -0,0 +1,44 @@ | |||
package db | |||
import ( | |||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" | |||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | |||
"xorm.io/xorm" | |||
) | |||
// MasterMallOrderStatisticsInsert 插入单条数据 | |||
func MasterMallOrderStatisticsInsert(officialDb *xorm.Engine, MasterMallOrderStatistics *model.MasterMallOrderStatistics) (int, error) { | |||
_, err := officialDb.InsertOne(MasterMallOrderStatistics) | |||
if err != nil { | |||
return 0, err | |||
} | |||
return MasterMallOrderStatistics.Id, nil | |||
} | |||
func GetMasterMallOrderStatistics(officialDb *xorm.Engine, masterId int, date string) (m *model.MasterMallOrderStatistics, err error) { | |||
m = new(model.MasterMallOrderStatistics) | |||
has, err := officialDb.Where("master_id =?", masterId).And("date =?", date).Get(m) | |||
if err != nil { | |||
return nil, zhios_order_relate_logx.Error(err) | |||
} | |||
if has == false { | |||
return nil, nil | |||
} | |||
return m, nil | |||
} | |||
func MasterMallOrderStatisticsUpdate(officialDb *xorm.Engine, id interface{}, m *model.MasterMallOrderStatistics, forceColums ...string) (int64, error) { | |||
var ( | |||
affected int64 | |||
err error | |||
) | |||
if forceColums != nil { | |||
affected, err = officialDb.Where("id=?", id).Cols(forceColums...).Update(m) | |||
} else { | |||
affected, err = officialDb.Where("id=?", id).Update(m) | |||
} | |||
if err != nil { | |||
return 0, err | |||
} | |||
return affected, nil | |||
} |
@@ -0,0 +1,44 @@ | |||
package db | |||
import ( | |||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" | |||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | |||
"xorm.io/xorm" | |||
) | |||
// MasterO2oOrderStatisticsInsert 插入单条数据 | |||
func MasterO2oOrderStatisticsInsert(officialDb *xorm.Engine, MasterO2oOrderStatistics *model.MasterO2oOrderStatistics) (int, error) { | |||
_, err := officialDb.InsertOne(MasterO2oOrderStatistics) | |||
if err != nil { | |||
return 0, err | |||
} | |||
return MasterO2oOrderStatistics.Id, nil | |||
} | |||
func GetMasterO2oOrderStatistics(officialDb *xorm.Engine, masterId int, date string) (m *model.MasterO2oOrderStatistics, err error) { | |||
m = new(model.MasterO2oOrderStatistics) | |||
has, err := officialDb.Where("master_id =?", masterId).And("date =?", date).Get(m) | |||
if err != nil { | |||
return nil, zhios_order_relate_logx.Error(err) | |||
} | |||
if has == false { | |||
return nil, nil | |||
} | |||
return m, nil | |||
} | |||
func MasterO2oOrderStatisticsUpdate(officialDb *xorm.Engine, id interface{}, m *model.MasterO2oOrderStatistics, forceColums ...string) (int64, error) { | |||
var ( | |||
affected int64 | |||
err error | |||
) | |||
if forceColums != nil { | |||
affected, err = officialDb.Where("id=?", id).Cols(forceColums...).Update(m) | |||
} else { | |||
affected, err = officialDb.Where("id=?", id).Update(m) | |||
} | |||
if err != nil { | |||
return 0, err | |||
} | |||
return affected, nil | |||
} |
@@ -0,0 +1,44 @@ | |||
package db | |||
import ( | |||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" | |||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | |||
"xorm.io/xorm" | |||
) | |||
// MasterO2oPayOrderStatisticsInsert 插入单条数据 | |||
func MasterO2oPayOrderStatisticsInsert(officialDb *xorm.Engine, MasterO2oPayOrderStatistics *model.MasterO2oPayOrderStatistics) (int, error) { | |||
_, err := officialDb.InsertOne(MasterO2oPayOrderStatistics) | |||
if err != nil { | |||
return 0, err | |||
} | |||
return MasterO2oPayOrderStatistics.Id, nil | |||
} | |||
func GetMasterO2oPayOrderStatistics(officialDb *xorm.Engine, masterId int, date string) (m *model.MasterO2oPayOrderStatistics, err error) { | |||
m = new(model.MasterO2oPayOrderStatistics) | |||
has, err := officialDb.Where("master_id =?", masterId).And("date =?", date).Get(m) | |||
if err != nil { | |||
return nil, zhios_order_relate_logx.Error(err) | |||
} | |||
if has == false { | |||
return nil, nil | |||
} | |||
return m, nil | |||
} | |||
func MasterO2oPayOrderStatisticsUpdate(officialDb *xorm.Engine, id interface{}, m *model.MasterO2oPayOrderStatistics, forceColums ...string) (int64, error) { | |||
var ( | |||
affected int64 | |||
err error | |||
) | |||
if forceColums != nil { | |||
affected, err = officialDb.Where("id=?", id).Cols(forceColums...).Update(m) | |||
} else { | |||
affected, err = officialDb.Where("id=?", id).Update(m) | |||
} | |||
if err != nil { | |||
return 0, err | |||
} | |||
return affected, nil | |||
} |
@@ -0,0 +1,22 @@ | |||
package model | |||
type MasterB2cOrderStatistics struct { | |||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||
MasterId int `json:"master_id" xorm:"not null default 0 comment('站长id') INT(11)"` | |||
PaymentTotal string `json:"payment_total" xorm:"not null default 0.0000 comment('付款金额(元)') DECIMAL(10,4)"` | |||
OrderCount int `json:"order_count" xorm:"not null default 0 comment('订单数量(笔)') INT(11)"` | |||
EstimatedCommission string `json:"estimated_commission" xorm:"not null default 0.0000 comment('预估佣金(元)') DECIMAL(10,4)"` | |||
EstimatedProfit string `json:"estimated_profit" xorm:"not null default 0.0000 comment('预估利润(元)') DECIMAL(10,4)"` | |||
LoseOrderCount int `json:"lose_order_count" xorm:"not null default 0 comment('失效订单(笔)') INT(11)"` | |||
PlaceOrderNumOfPeople int `json:"place_order_num_of_people" xorm:"not null default 0 comment('下单人数(个)') INT(11)"` | |||
EffectiveOrderCount int `json:"effective_order_count" xorm:"not null default 0 comment('有效订单(笔)') INT(11)"` | |||
EffectiveCommission string `json:"effective_commission" xorm:"not null default 0.0000 comment('有效佣金(元)') DECIMAL(10,4)"` | |||
ReceiveCommission string `json:"receive_commission" xorm:"not null default 0.0000 comment('收货佣金(元)') DECIMAL(10,4)"` | |||
LoseCommission string `json:"lose_commission" xorm:"not null default 0.0000 comment('失效佣金(元)') DECIMAL(10,4)"` | |||
AvgCommission string `json:"avg_commission" xorm:"not null default 0.0000 comment('平均佣金(元)') DECIMAL(10,4)"` | |||
CustomerUnitPrice string `json:"customer_unit_price" xorm:"not null default 0.0000 comment('客单价(元)') DECIMAL(10,4)"` | |||
Date string `json:"date" xorm:"not null default '0000-00-00' comment('统计时间') VARCHAR(50)"` | |||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
UpdateAt string `json:"update_at" xorm:"default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
EffectivePaymentTotal string `json:"effective_payment_total" xorm:"not null default 0.0000 comment('有效付款金额(元)') DECIMAL(10,4)"` | |||
} |
@@ -0,0 +1,22 @@ | |||
package model | |||
type MasterMallOrderStatistics struct { | |||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||
MasterId int `json:"master_id" xorm:"not null default 0 comment('站长id') INT(11)"` | |||
PaymentTotal string `json:"payment_total" xorm:"not null default 0.0000 comment('付款金额(元)') DECIMAL(10,4)"` | |||
OrderCount int `json:"order_count" xorm:"not null default 0 comment('订单数量(笔)') INT(11)"` | |||
EstimatedCommission string `json:"estimated_commission" xorm:"not null default 0.0000 comment('预估佣金(元)') DECIMAL(10,4)"` | |||
EstimatedProfit string `json:"estimated_profit" xorm:"not null default 0.0000 comment('预估利润(元)') DECIMAL(10,4)"` | |||
LoseOrderCount int `json:"lose_order_count" xorm:"not null default 0 comment('失效订单(笔)') INT(11)"` | |||
PlaceOrderNumOfPeople int `json:"place_order_num_of_people" xorm:"not null default 0 comment('下单人数(个)') INT(11)"` | |||
EffectiveOrderCount int `json:"effective_order_count" xorm:"not null default 0 comment('有效订单(笔)') INT(11)"` | |||
EffectiveCommission string `json:"effective_commission" xorm:"not null default 0.0000 comment('有效佣金(元)') DECIMAL(10,4)"` | |||
ReceiveCommission string `json:"receive_commission" xorm:"not null default 0.0000 comment('收货佣金(元)') DECIMAL(10,4)"` | |||
LoseCommission string `json:"lose_commission" xorm:"not null default 0.0000 comment('失效佣金(元)') DECIMAL(10,4)"` | |||
AvgCommission string `json:"avg_commission" xorm:"not null default 0.0000 comment('平均佣金(元)') DECIMAL(10,4)"` | |||
CustomerUnitPrice string `json:"customer_unit_price" xorm:"not null default 0.0000 comment('客单价(元)') DECIMAL(10,4)"` | |||
Date string `json:"date" xorm:"not null default '0000-00-00' comment('统计时间') VARCHAR(50)"` | |||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
UpdateAt string `json:"update_at" xorm:"default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
EffectivePaymentTotal string `json:"effective_payment_total" xorm:"not null default 0.0000 comment('有效付款金额(元)') DECIMAL(10,4)"` | |||
} |
@@ -0,0 +1,22 @@ | |||
package model | |||
type MasterO2oOrderStatistics struct { | |||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||
MasterId int `json:"master_id" xorm:"not null default 0 comment('站长id') INT(11)"` | |||
PaymentTotal string `json:"payment_total" xorm:"not null default 0.0000 comment('付款金额(元)') DECIMAL(10,4)"` | |||
OrderCount int `json:"order_count" xorm:"not null default 0 comment('订单数量(笔)') INT(11)"` | |||
EstimatedCommission string `json:"estimated_commission" xorm:"not null default 0.0000 comment('预估佣金(元)') DECIMAL(10,4)"` | |||
EstimatedProfit string `json:"estimated_profit" xorm:"not null default 0.0000 comment('预估利润(元)') DECIMAL(10,4)"` | |||
LoseOrderCount int `json:"lose_order_count" xorm:"not null default 0 comment('失效订单(笔)') INT(11)"` | |||
PlaceOrderNumOfPeople int `json:"place_order_num_of_people" xorm:"not null default 0 comment('下单人数(个)') INT(11)"` | |||
EffectiveOrderCount int `json:"effective_order_count" xorm:"not null default 0 comment('有效订单(笔)') INT(11)"` | |||
EffectiveCommission string `json:"effective_commission" xorm:"not null default 0.0000 comment('有效佣金(元)') DECIMAL(10,4)"` | |||
ReceiveCommission string `json:"receive_commission" xorm:"not null default 0.0000 comment('收货佣金(元)') DECIMAL(10,4)"` | |||
LoseCommission string `json:"lose_commission" xorm:"not null default 0.0000 comment('失效佣金(元)') DECIMAL(10,4)"` | |||
AvgCommission string `json:"avg_commission" xorm:"not null default 0.0000 comment('平均佣金(元)') DECIMAL(10,4)"` | |||
CustomerUnitPrice string `json:"customer_unit_price" xorm:"not null default 0.0000 comment('客单价(元)') DECIMAL(10,4)"` | |||
Date string `json:"date" xorm:"not null default '0000-00-00' comment('统计时间') VARCHAR(50)"` | |||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
UpdateAt string `json:"update_at" xorm:"default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
EffectivePaymentTotal string `json:"effective_payment_total" xorm:"not null default 0.0000 comment('有效付款金额(元)') DECIMAL(10,4)"` | |||
} |
@@ -0,0 +1,15 @@ | |||
package model | |||
type MasterO2oPayOrderStatistics struct { | |||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||
MasterId int `json:"master_id" xorm:"not null default 0 comment('站长id') INT(11)"` | |||
PaymentTotal string `json:"payment_total" xorm:"not null default 0.0000 comment('付款金额(元)') DECIMAL(10,4)"` | |||
OrderCount int `json:"order_count" xorm:"not null default 0 comment('订单数量(笔)') INT(11)"` | |||
EstimatedCommission string `json:"estimated_commission" xorm:"not null default 0.0000 comment('预估佣金(元)') DECIMAL(10,4)"` | |||
PlaceOrderNumOfPeople int `json:"place_order_num_of_people" xorm:"not null default 0 comment('下单人数(个)') INT(11)"` | |||
AvgCommission string `json:"avg_commission" xorm:"not null default 0.0000 comment('平均佣金(元)') DECIMAL(10,4)"` | |||
CustomerUnitPrice string `json:"customer_unit_price" xorm:"not null default 0.0000 comment('客单价(元)') DECIMAL(10,4)"` | |||
Date string `json:"date" xorm:"not null default '0000-00-00' comment('统计时间') VARCHAR(50)"` | |||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
UpdateAt string `json:"update_at" xorm:"default 'CURRENT_TIMESTAMP' TIMESTAMP"` | |||
} |