Guest User

Untitled

a guest
Jan 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function getAccountBill() {
  2. const accountBill = `2222${Math.floor(
  3. Math.random() * 90000000000000000000,
  4. ) + 10000000000000000000}`;
  5.  
  6. Bill.findOne({
  7. where: {
  8. account_bill: accountBill,
  9. },
  10. })
  11. .then(isAccountBill => {
  12. if (!isAccountBill) {
  13. getAccountBill();
  14. }
  15. return accountBill;
  16. })
  17. .catch(err => {
  18. /* just ignore */
  19. });
  20. }
Add Comment
Please, Sign In to add comment