示例#1
0
func GetPurchaseList(sqlBuilder *wbo.SqlBuilder) (string, []map[string]interface{}) {
	query := sqlBuilder.GetCustomerSql(purchaseListSql)
	values := sqlBuilder.GetValues()
	beego.Debug("GetPurchaseList: ", query, values)

	o := orm.NewOrm()
	var resultMaps []orm.Params
	retList := make([]map[string]interface{}, 0)
	_, err := o.Raw(query, values...).Values(&resultMaps)
	if err == nil {
		retList = make([]map[string]interface{}, len(resultMaps))
		for idx, oldMap := range resultMaps {
			retList[idx] = transPurchaseMap(oldMap)
		}
		return stat.Success, retList
	}
	beego.Error("GetPurchaseList Query error:", err)
	return stat.Failed, retList
}
示例#2
0
func GetPurchaseTotal(sqlBuilder *wbo.SqlBuilder) int64 {
	query := sqlBuilder.GetCustomerSql(purchaseCountSql)
	values := sqlBuilder.GetValues()
	beego.Debug("GetPurchaseTotal: ", query, ":", values)
	return wbo.QueryRawCount(query, values)
}