Skip to content

Commit

Permalink
Merge pull request #84 from lealife/patch-1
Browse files Browse the repository at this point in the history
 get_market_user_deals add `market` column return
  • Loading branch information
haipome committed Jun 6, 2018
2 parents 2bc782d + 08c0eb4 commit df3b4cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion readhistory/rh_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ json_t *get_market_user_deals(MYSQL *conn, uint32_t user_id, const char *market,
mysql_real_escape_string(conn, _market, market, market_len);

sds sql = sdsempty();
sql = sdscatprintf(sql, "SELECT `time`, `user_id`, `deal_id`, `side`, `role`, `price`, `amount`, `deal`, `fee`, `deal_order_id` "
sql = sdscatprintf(sql, "SELECT `time`, `user_id`, `deal_id`, `side`, `role`, `price`, `amount`, `deal`, `fee`, `deal_order_id`, `market` "
"FROM `user_deal_history_%u` where `user_id` = %u AND `market` = '%s' ORDER BY `id` DESC", user_id % HISTORY_HASH_NUM, user_id, _market);
if (offset) {
sql = sdscatprintf(sql, " LIMIT %zu, %zu", offset, limit);
Expand Down Expand Up @@ -299,6 +299,8 @@ json_t *get_market_user_deals(MYSQL *conn, uint32_t user_id, const char *market,
uint64_t deal_order_id = strtoull(row[9], NULL, 0);
json_object_set_new(record, "deal_order_id", json_integer(deal_order_id));

json_object_set_new(record, "market", json_string(row[10]));

json_array_append_new(records, record);
}
mysql_free_result(result);
Expand Down

0 comments on commit df3b4cb

Please sign in to comment.