|
@@ -26,8 +26,8 @@ type CygxArticleAndYanxuanRecordResp struct {
|
|
// 获取数量
|
|
// 获取数量
|
|
func GetCygxArticleAndYanxuanRecordCount(condition string, pars []interface{}) (count int, err error) {
|
|
func GetCygxArticleAndYanxuanRecordCount(condition string, pars []interface{}) (count int, err error) {
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_and_yanxuan_record as r
|
|
|
|
- INNER JOIN cygx_article as art ON art.article_id = r.source_id
|
|
|
|
|
|
+ sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_history_record_all as r
|
|
|
|
+ INNER JOIN cygx_article as art ON art.article_id = r.article_id
|
|
WHERE 1= 1 `
|
|
WHERE 1= 1 `
|
|
if condition != "" {
|
|
if condition != "" {
|
|
sqlCount += condition
|
|
sqlCount += condition
|
|
@@ -40,8 +40,8 @@ func GetCygxArticleAndYanxuanRecordCount(condition string, pars []interface{}) (
|
|
func GetCygxArticleAndYanxuanRecordCountWeekly(condition string, pars []interface{}) (count int, err error) {
|
|
func GetCygxArticleAndYanxuanRecordCountWeekly(condition string, pars []interface{}) (count int, err error) {
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
databaseName := utils.GetWeeklyDatabase()
|
|
databaseName := utils.GetWeeklyDatabase()
|
|
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_and_yanxuan_record as r
|
|
|
|
- INNER JOIN cygx_article as art ON art.article_id = r.source_id
|
|
|
|
|
|
+ sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_history_record_all as r
|
|
|
|
+ INNER JOIN cygx_article as art ON art.article_id = r.article_id
|
|
INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2
|
|
INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2
|
|
WHERE 1= 1 `
|
|
WHERE 1= 1 `
|
|
sqlCount = fmt.Sprintf(sqlCount, databaseName)
|
|
sqlCount = fmt.Sprintf(sqlCount, databaseName)
|
|
@@ -55,8 +55,8 @@ func GetCygxArticleAndYanxuanRecordCountWeekly(condition string, pars []interfac
|
|
// 列表
|
|
// 列表
|
|
func GetCygxArticleAndYanxuanRecordRespList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxArticleAndYanxuanRecordResp, err error) {
|
|
func GetCygxArticleAndYanxuanRecordRespList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxArticleAndYanxuanRecordResp, err error) {
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
- sql := `SELECT r.* ,art.title FROM cygx_article_and_yanxuan_record as r
|
|
|
|
- INNER JOIN cygx_article as art ON art.article_id = r.source_id WHERE 1= 1 `
|
|
|
|
|
|
+ sql := `SELECT r.* ,art.title FROM cygx_article_history_record_all as r
|
|
|
|
+ INNER JOIN cygx_article as art ON art.article_id = r.article_id WHERE 1= 1 `
|
|
if condition != "" {
|
|
if condition != "" {
|
|
sql += condition
|
|
sql += condition
|
|
}
|
|
}
|
|
@@ -69,8 +69,8 @@ func GetCygxArticleAndYanxuanRecordRespList(condition string, pars []interface{}
|
|
func GetCygxArticleAndYanxuanRecordRespListWeekly(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxArticleAndYanxuanRecordResp, err error) {
|
|
func GetCygxArticleAndYanxuanRecordRespListWeekly(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxArticleAndYanxuanRecordResp, err error) {
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
databaseName := utils.GetWeeklyDatabase()
|
|
databaseName := utils.GetWeeklyDatabase()
|
|
- sql := `SELECT r.* FROM cygx_article_and_yanxuan_record as r
|
|
|
|
- INNER JOIN cygx_article as art ON art.article_id = r.source_id
|
|
|
|
|
|
+ sql := `SELECT r.* FROM cygx_article_history_record_all as r
|
|
|
|
+ INNER JOIN cygx_article as art ON art.article_id = r.article_id
|
|
INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2
|
|
INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2
|
|
WHERE 1= 1 `
|
|
WHERE 1= 1 `
|
|
sql = fmt.Sprintf(sql, databaseName)
|
|
sql = fmt.Sprintf(sql, databaseName)
|