From f82626dfab82ad2b21db7b0d167a69e2edff8b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Thu, 21 Jul 2022 17:05:38 +0800 Subject: [PATCH 1/2] * Fix api bug. --- framework/api/entry.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php index beadc3089a..5c89698e49 100644 --- a/framework/api/entry.class.php +++ b/framework/api/entry.class.php @@ -535,7 +535,7 @@ class baseEntry /* Format array. */ $value = array(); - if(is_array($object->$key)) + if(is_array($object->$key) or is_object($object->$key)) { foreach($object->$key as $v) $value[] = $this->cast($v, $type); } From 99f4bb5877aa7fbb198ba5f9b0c802a61277b3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Thu, 21 Jul 2022 17:06:21 +0800 Subject: [PATCH 2/2] * Add param. --- api/v1/entries/productplans.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/entries/productplans.php b/api/v1/entries/productplans.php index f8313c1683..6fc0b0757e 100644 --- a/api/v1/entries/productplans.php +++ b/api/v1/entries/productplans.php @@ -24,7 +24,7 @@ class productplansEntry extends entry if(!$productID) return $this->sendError(400, 'No product id.'); $control = $this->loadController('productplan', 'browse'); - $control->browse($productID, $this->param('branch', 0), $this->param('status', 'all'), $this->param('order', 'begin_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); + $control->browse($productID, $this->param('branch', 0), $this->param('status', 'all'), $this->param('query', 0), $this->param('order', 'begin_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); /* Response */ $data = $this->getData();