Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. $query = $mysqli->query("SELECT `contest_id`, `type_operation`, `name_val`, `name_prod`, `price`, SUM(`amount`) as amount , `total`, `dttm_create_order`, `dttm_close_order`, `status` FROM (SELECT `contest_id`, `type_operation`, `name_val`, `name_prod`, `price` , `amount` as amount , `total` , `dttm_create_order`, `dttm_close_order`, `status` FROM `bitorders` UNION SELECT `contest_id`, `type_operation`, `name_val`, `name_prod`, `price`, `amount` as amount , `total`, `dttm_create_order`, `dttm_close_order`, `status` FROM `orders` ) as tableobsh WHERE `name_prod`= 'aaa' AND status = 0 GROUP BY price , type_operation ORDER BY price " );
  2.  
  3. while ($row = $query->fetch_assoc()) {
  4. //$orderbook['order_id'][] = $row['order_id'];
  5. $orderbook['price'][] = $row['price']/100000000;
  6. //$orderbook['user_id'][] = $row['user_id'];
  7. $orderbook['contest_id'][] = $row['contest_id'];
  8. $orderbook['type_operation'][] = $row['type_operation'];
  9. $orderbook['name_val'][] = $row['name_val'];
  10. $orderbook['name_prod'][] = $row['name_prod'];
  11. $orderbook['amount'][] = $row['amount']/100000000;
  12. $orderbook['total'][] = $row['total']/100000000;
  13. $orderbook['dttm_create_order'][] = $row['dttm_create_order'];
  14. $orderbook['dttm_close_order'][] = $row['dttm_close_order'];
  15. $orderbook['status'][] = $row['status'];
  16.  
  17. }
  18. $out = array(
  19. 'orderbook' => $orderbook
  20. );
  21.  
  22. WHERE `name_prod`= 'aaa'
  23.  
  24. $coins = array('aaa', 'bbb', 'ccc');
  25. WHERE `name_prod` IN (" . implode(',', $coins) . ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement