Compare commits

..

No commits in common. "57ff4c09176379eba2281acd0559124e12a2ced8" and "7baf8670c5c0311555c96a1642947119a4759f09" have entirely different histories.

5 changed files with 14 additions and 34 deletions

View File

@ -449,7 +449,7 @@ async def get_baidu_orderlist(ns={}):
# 获取余额
user_balance = await getCustomerBalance(sor, orgid[0]['id'])
# 判断余额是否大于50
if user_balance < 500:
if user_balance < 5000000:
await sor.rollback()
paydata = {'queryAccountId': baidu_users[0]['baidu_id'], 'orderIds': [ns.get('order_id')]}
ns_format = '&'.join(['%s=%s' % (k, v) for k, v in ns.items()])

View File

@ -34,7 +34,10 @@ async def front_news_search(ns={}):
publish_time_zh, publish_time_en, read_count
from enterprise_news_article
where %s
order by publish_time_zh desc, update_time desc
order by greatest(
ifnull(publish_time_zh, '1000-01-01'),
ifnull(publish_time_en, '1000-01-01')
) desc, update_time desc
limit %s offset %s;
""" % (where_clause, page_size, offset)
result = await sor.sqlExe(search_sql, {})

View File

@ -88,7 +88,7 @@ async def news_article_search(ns={}):
'status': True,
'msg': 'search news article success',
'data': result,
'article_type_summary': article_type_summary_zh,
'article_type_summary_zh': article_type_summary_zh,
'article_type_summary_en': article_type_summary_en,
'pagination': {
'total': total_count,

View File

@ -15,7 +15,7 @@
</article>
</section>
</main>
</template>
</template>
<script>
import docs from './agreementDocs'

View File

@ -190,9 +190,7 @@ export default {
status: '',
keyword: ''
},
articleList: [],
articleTypeSummary: [],
articleTypeSummaryEn: []
articleList: []
}
},
computed: {
@ -217,18 +215,12 @@ export default {
行业洞察: { label: '行业洞察', type: '行业洞察', icon: 'el-icon-data-analysis', iconClass: 'amber' },
活动资讯: { label: '活动资讯', type: '活动资讯', icon: 'el-icon-date', iconClass: 'purple' }
}
const summaryMap = {}
this.articleTypeSummary.forEach(item => {
if (item && item.article_type) {
summaryMap[item.article_type] = item
}
})
return Object.values(map).map(item => {
const summary = summaryMap[item.type] || {}
const list = this.articleList.filter(article => article.type === item.type)
return {
...item,
count: Number(summary.article_count || 0),
views: Number(summary.read_count || 0)
count: list.length,
views: list.reduce((total, article) => total + Number(article.views || 0), 0)
}
})
}
@ -320,18 +312,6 @@ export default {
}
}
},
getArticleTypeSummary(res) {
if (Array.isArray(res.article_type_summary)) return res.article_type_summary
const data = res.data && !Array.isArray(res.data) ? res.data : {}
if (Array.isArray(data.article_type_summary)) return data.article_type_summary
return []
},
getArticleTypeSummaryEn(res) {
if (Array.isArray(res.article_type_summary_en)) return res.article_type_summary_en
const data = res.data && !Array.isArray(res.data) ? res.data : {}
if (Array.isArray(data.article_type_summary_en)) return data.article_type_summary_en
return []
},
getResponseList(res) {
//
if (Array.isArray(res.data)) return res.data
@ -404,19 +384,16 @@ export default {
const list = this.getResponseList(res)
//
this.articleList = list.map(item => this.normalizeArticle(item))
this.articleTypeSummary = this.getArticleTypeSummary(res)
this.articleTypeSummaryEn = this.getArticleTypeSummaryEn(res)
//
this.total = this.getResponseTotal(res, list)
return
}
//
this.articleList = []
this.articleTypeSummary = []
this.articleTypeSummaryEn = []
this.total = 0
} catch (error) {
//
this.articleList = []
this.articleTypeSummary = []
this.articleTypeSummaryEn = []
this.total = 0
this.$message.error('文章列表加载失败')
} finally {