|
@@ -33,7 +33,7 @@ func (c *ContractIncomeHistory) TableName() string {
|
|
|
|
|
|
// GetIncomeHistory
|
|
// GetIncomeHistory
|
|
func GetIncomeHistory(condition string, pars []interface{}) (results []*IncomeSummaryItem, err error) {
|
|
func GetIncomeHistory(condition string, pars []interface{}) (results []*IncomeSummaryItem, err error) {
|
|
- sql := `SELECT amount,seller_name,new_company AS contract_type,company_name,invoice_time AS invoice_date,
|
|
|
|
|
|
+ sql := `SELECT amount,amount AS origin_amount,seller_name,new_company AS contract_type,company_name,invoice_time AS invoice_date,
|
|
seller_id as final_seller_id,group_id AS seller_group_id,'CNY' AS currency_unit FROM contract_income_history WHERE `
|
|
seller_id as final_seller_id,group_id AS seller_group_id,'CNY' AS currency_unit FROM contract_income_history WHERE `
|
|
sql += condition
|
|
sql += condition
|
|
sql += ` ORDER BY invoice_date `
|
|
sql += ` ORDER BY invoice_date `
|
|
@@ -71,8 +71,8 @@ func GetIncomeHistoryPage(condition string, pars []interface{}, page *base.Page)
|
|
sql += condition
|
|
sql += condition
|
|
|
|
|
|
query := global.DEFAULT_MYSQL.Table("contract_income_history").
|
|
query := global.DEFAULT_MYSQL.Table("contract_income_history").
|
|
- Select("amount,seller_name,new_company AS contract_type,company_name," +
|
|
|
|
- "invoice_time AS invoice_date, seller_id as final_seller_id,group_id AS seller_group_id," +
|
|
|
|
|
|
+ Select("amount,seller_name,new_company AS contract_type,company_name,"+
|
|
|
|
+ "invoice_time AS invoice_date, seller_id as final_seller_id,group_id AS seller_group_id,"+
|
|
"'CNY' AS currency_unit").Where(condition, pars...)
|
|
"'CNY' AS currency_unit").Where(condition, pars...)
|
|
if len(page.GetOrderItemsString()) > 0 {
|
|
if len(page.GetOrderItemsString()) > 0 {
|
|
query = query.Order(page.GetOrderItemsString())
|
|
query = query.Order(page.GetOrderItemsString())
|
|
@@ -82,4 +82,4 @@ func GetIncomeHistoryPage(condition string, pars []interface{}, page *base.Page)
|
|
|
|
|
|
err = query.Limit(int(page.GetPageSize())).Offset(int(page.Offset())).Find(&results).Error
|
|
err = query.Limit(int(page.GetPageSize())).Offset(int(page.Offset())).Find(&results).Error
|
|
return
|
|
return
|
|
-}
|
|
|
|
|
|
+}
|