Browse Source

redis部署

reloadnike 2 years ago
parent
commit
e115b9dba0
2 changed files with 34 additions and 2 deletions
  1. 32 0
      App/HttpController/Index.php
  2. 2 2
      App/HttpController/ProductService.php

+ 32 - 0
App/HttpController/Index.php

@@ -18,6 +18,38 @@ class Index extends Controller
         $this->response()->write(file_get_contents($file));
     }
 
+    /**
+     * 3.5  商品上下架状态接口
+     *
+     * @param $skuArr
+     *
+     * @return array|bool
+     */
+    public function skuState()
+    {
+        // 获取 `POST` 或者 `GET` 提交的所有参数
+        $data = $this->request()->getRequestParam();
+//var_dump($data);
+
+        // 返回给客户端
+        //$this->response()->write($data . PHP_EOL);
+
+        $skuArr = $data['skuArr'];
+
+        //$sku = implode(',', $skuArr);
+        $this->JdSdk = new JdSdk();
+//var_dump($skuArr);
+        $response = $this->JdSdk->api_product_sku_state($skuArr);
+        print_r($response);
+        $this->response()->write($response . PHP_EOL);
+        //$response = json_decode($response, true);
+//        =====$response=====
+//        { "success": true, "resultMessage": "操作成功", "resultCode": "0000", "result": [ { "state": 0, "sku": 5729524 } ], "code": 200 }
+
+        //return $response;
+
+    }
+
     function test()
     {
         $this->response()->write('this is test');

+ 2 - 2
App/HttpController/ProductService.php

@@ -26,7 +26,7 @@ class ProductService extends Controller
      *
      * @return array|bool
      */
-    public function skuState($skuArr)
+    public function skuState()
     {
         // 获取 `POST` 或者 `GET` 提交的所有参数
         $data = $this->request()->getRequestParam();
@@ -78,7 +78,7 @@ var_dump($data);
      *
      * @return string
      */
-    function api_price_get_price($sku)
+    function api_price_get_price()
     {
         // 获取 `POST` 或者 `GET` 提交的所有参数
         $data = $this->request()->getRequestParam();