Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $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 " );
- while ($row = $query->fetch_assoc()) {
- //$orderbook['order_id'][] = $row['order_id'];
- $orderbook['price'][] = $row['price']/100000000;
- //$orderbook['user_id'][] = $row['user_id'];
- $orderbook['contest_id'][] = $row['contest_id'];
- $orderbook['type_operation'][] = $row['type_operation'];
- $orderbook['name_val'][] = $row['name_val'];
- $orderbook['name_prod'][] = $row['name_prod'];
- $orderbook['amount'][] = $row['amount']/100000000;
- $orderbook['total'][] = $row['total']/100000000;
- $orderbook['dttm_create_order'][] = $row['dttm_create_order'];
- $orderbook['dttm_close_order'][] = $row['dttm_close_order'];
- $orderbook['status'][] = $row['status'];
- }
- $out = array(
- 'orderbook' => $orderbook
- );
- WHERE `name_prod`= 'aaa'
- $coins = array('aaa', 'bbb', 'ccc');
- WHERE `name_prod` IN (" . implode(',', $coins) . ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement