Commit db9cb167 authored by 任国军's avatar 任国军

option add sort

parent 347ac473
Pipeline #19576 passed with stage
in 2 seconds
......@@ -11,6 +11,7 @@ module.exports = app => {
type: ENUM('loan', 'credit'),
key: STRING,
valid: INTEGER,
sort: INTEGER,
// 注意,需要转成string
created_at: {
type: DATE,
......
......@@ -34,7 +34,7 @@ class ProductService extends Service {
// const type = 'credit';
// keys = ['loan_organization', 'loan_filter', 'credit_bank', 'credit_theme', 'credit_filter'];
// console.info(keys);
let classifies = await ctx.blockModel.RecommendChannelClassify.all({ where: { type, valid: 1, key: { $in: keys } } });
let classifies = await ctx.blockModel.RecommendChannelClassify.findAll({ where: { type, valid: 1, key: { $in: keys } }, order: [[ 'sort', 'asc' ]] });
// return classifies;
classifies = R.project([ 'id', 'key', 'title', 'description' ])(classifies);
const classify_ids = R.pluck('id', classifies);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment