Commit 067dbc64 by 杨树贤

fix

parent afdbe1ba
...@@ -21,7 +21,11 @@ class SkuApiController extends Controller ...@@ -21,7 +21,11 @@ class SkuApiController extends Controller
{ {
$skuService = new SkuService(); $skuService = new SkuService();
$data = $skuService->getSkuList(); $data = $skuService->getSkuList();
$this->response(0, 'ok', $data['list'], $data['total']); if (is_array($data)) {
$this->response(0, 'ok', $data['list'], $data['total']);
} else {
$this->response(-1, '获取数据失败,原因是 : ' . $data);
}
} }
public function UpdateSkuStatus($request) public function UpdateSkuStatus($request)
......
...@@ -36,7 +36,7 @@ class SkuService extends BaseService ...@@ -36,7 +36,7 @@ class SkuService extends BaseService
try { try {
$return = curl($url, $map, 1); $return = curl($url, $map, 1);
} catch (\Exception $e) { } catch (\Exception $e) {
return [$e->getMessage()]; return $e->getMessage();
} }
$data = json_decode($return, true); $data = json_decode($return, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment