diff --git a/app/models/Order.php b/app/models/Order.php
index 3e1618f1a53c0ddacb054a99eb0f3451f79336ca..6d032af56101774c55cf0c8c44320c9be9642686 100644
--- a/app/models/Order.php
+++ b/app/models/Order.php
@@ -9,12 +9,26 @@ class Order extends Model
FROM orders INNER JOIN book ON orders.bookID = book.bookID
LEFT JOIN review ON review.orderID=orders.orderID
WHERE userid = '". $id ."') AS temp ORDER BY date DESC";
+
+ $sql = "SELECT orderID, bookID WHERE userID = " . $id . "ORDER BY id DESC";
$result = $this->conn->query($sql);
$results = [];
while ($row = $result->fetch_assoc()) {
$results[] = $row;
}
-
+ $soap = new SoapHelper();
+ foreach ($results as $key -> $value) {
+ $data = []
+ $data['book'] = $soap->getBookByID($results[$key]['bookID']);
+ $data['order'] = $soap->getTransactionByID($results[$key]['orderID']);
+ $results[$key]['date'] = $data['order']['timestamp'];
+ $results[$key]['quantity'] = $data['order']['jumlah'];
+ $results[$key]['bookPicture'] = $data['book']['bookPicture'];
+ //TODO REVIEW
+ $results[$key]['reviewID'] = '';
+ $results[$key]['title'] = $data['book']['title'];
+ $results[$key]['userID'] = $id;
+ }
return $results;
}