Skip to content
Snippets Groups Projects
Unverified Commit 681bfc60 authored by yusufrahmatp's avatar yusufrahmatp
Browse files

Change how to get history from database using webservice buku instead from database

parent a1b63502
No related merge requests found
......@@ -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;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment