Commit 6d00090a authored by 姜登's avatar 姜登

product

parent 8d3649fe
Pipeline #22315 passed with stage
in 3 seconds
......@@ -109,7 +109,7 @@ class UserService extends Service {
const last_day = moment(new Date()).subtract(1, 'day').format('YYYY-MM-DD');
const last_month = moment(new Date()).subtract(1, 'day').format('YYYYMM');
const lastday_data = await ctx.dataModel.YzbillCost.findOne({
const lastday_data = await ctx.dataModel.YzbillCost.findAll({
attributes: [
[ctx.dataModel.fn('SUM', 'pull_volumn'), 'amount'],
[ctx.dataModel.fn('SUM', 'cost'), 'cost'],
......
......@@ -59,9 +59,12 @@ class UserDetailService extends Service {
let where = { user_id };
if (product) {
product = JSON.parse(product);
if (product.length > 0) {
ret.product = product;
where.service = product;
}
}
const appKeys = await ctx.yizhiModel.UserService.findAll({
attributes: ['service', 'appkey'],
......@@ -139,8 +142,12 @@ class UserDetailService extends Service {
let where = { user_id };
if (product) {
product = JSON.parse(product);
if (product.length > 0) {
ret.product = product;
where.service = product;
}
}
const appKeys = await ctx.yizhiModel.UserService.findAll({
attributes: ['service', 'appkey'],
......@@ -154,6 +161,9 @@ class UserDetailService extends Service {
appList.push(value.appkey);
}
});
if (end_date.length === 7) {
end_date = moment(end_date + '-01').add(1, 'month').format('YYYY-MM');
}
where = {
user_id: ctx.userId,
appKey: appList,
......
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