All files / koa/util date.js

75% Statements 3/4
100% Branches 0/0
0% Functions 0/1
75% Lines 3/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10  5x 5x         5x    
'use strict'
const moment = require('moment')
const _ = require('lodash')
 
/**
 * 获取时间轴加随机数的订单号
 */
exports.getOrderId = () => {
  return moment().format('YYMMDDHHmmssSSS') + _.random(100, 999) // 17+3 =20位-2 =18
}