Revert to regular json_encode because auto int conversion sucks

This commit is contained in:
root 2018-08-13 14:34:47 +08:00
parent e638e63e81
commit b3eb68346f
2 changed files with 4 additions and 3 deletions

View file

@ -1587,8 +1587,8 @@ class APIController extends Controller
$items[] = [
'id' => $item->getID(),
'title' => $item->getTitle(),
'qty' => $item->getQuantity(),
'price' => $item->getPrice(),
'qty' => (int) $item->getQuantity(),
'price' => (float) $item->getPrice(),
];
}

View file

@ -68,7 +68,8 @@ class APIResult
'data' => $this->data
];
$json_data = json_encode($return_data, JSON_NUMERIC_CHECK);
// $json_data = json_encode($return_data, JSON_NUMERIC_CHECK);
$json_data = json_encode($return_data);
$json = new Response($json_data);
return $json;