Guest User

Untitled

a guest
Oct 26th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. $new = new Webhook;
  2. $new->hash = $txData['data']['hash'];
  3. $new->wallet = $wallet;
  4. $new->vezes = $semanas;
  5. $new->valor = BlocktrailSDK::toBtc($txData['data']['estimated_value']);
  6. $new->pagamento = $pagar;
  7. $new->save();
  8.  
  9. $user = Wallets::where('wallet', $wallet)->get();
  10.  
  11. foreach($user as $usuario){
  12.  
  13. $id = $usuario->id_user;
  14.  
  15. $invest = Investimento::where('wallet', $wallet)->first();
  16. $invest->hash = $txData['data']['hash'];
  17. $invest->id_user = $id;
  18. $invest->wallet = $wallet;
  19. $invest->deposito = BlocktrailSDK::toBtc($txData['data']['estimated_value']);
  20. $invest->status = 'pendente';
  21. $invest->save();
  22.  
  23. }
  24.  
  25. $invest = Investimento::where(array('id_user' => $id, 'wallet' => $wallet));
Add Comment
Please, Sign In to add comment