Commit 43c34460 authored by Hsinli's avatar Hsinli

add

parent 6b28adbc
......@@ -58,15 +58,19 @@ class OrderService extends Service {
async getReportValid(type, reportId) {
const { ctx } = this;
let valid = 0;
if (![1, 2].includes(type)) {
return valid;
}
let timeLine = (type === 1) ? 15 : 30;
let orderFilter = {
where: {
report_id: reportId,
type: type,
valid: 1
}
};
let orderInfo = await ctx.prometheusModel.CreditOrder.findOne(orderFilter);
if (orderInfo != null) {
let timeLine = (type === 1) ? 15 : 30;
if (orderInfo.state === '已支付' && moment(orderInfo.state_time).add(timeLine, 'days').format('YYYY-MM-DD HH:ii:ss') > moment().format('YYYY-MM-DD HH:ii:ss')) {
valid = 1;
}
......
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