|
@@ -5,9 +5,11 @@ namespace App\HttpController;
|
|
|
|
|
|
|
|
|
use EasySwoole\Http\AbstractInterface\Controller;
|
|
|
+use App\Com\JdSdk;
|
|
|
|
|
|
class Index extends Controller
|
|
|
{
|
|
|
+ protected $JdSdk;
|
|
|
|
|
|
public function index()
|
|
|
{
|
|
@@ -29,19 +31,15 @@ class Index extends Controller
|
|
|
{
|
|
|
|
|
|
$data = $this->request()->getRequestParam();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
$skuArr = $data['skuArr'];
|
|
|
|
|
|
-
|
|
|
$this->JdSdk = new JdSdk();
|
|
|
-
|
|
|
+
|
|
|
$response = $this->JdSdk->api_product_sku_state($skuArr);
|
|
|
- print_r($response);
|
|
|
+
|
|
|
$this->response()->write($response . PHP_EOL);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -50,6 +48,55 @@ class Index extends Controller
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 6.2 批量获取库存接口(建议订单详情页、下单使用)
|
|
|
+ *
|
|
|
+ * @param $skuNums
|
|
|
+ * @param $area
|
|
|
+ * $skuNums商品和数量 此是个String 再重构吧 [{skuId: 569172,num:101}], $area格式:1_0_0 (分别代表1、2、3级地址)
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function skuStock()
|
|
|
+ {
|
|
|
+
|
|
|
+ $data = $this->request()->getRequestParam();
|
|
|
+
|
|
|
+ $skuArr = $data['skuArr'];
|
|
|
+
|
|
|
+ $area = $data['area'];
|
|
|
+
|
|
|
+ $this->JdSdk = new JdSdk();
|
|
|
+
|
|
|
+ $response = $this->JdSdk->api_stock_get_new_stock_by_id($skuArr, $area);
|
|
|
+
|
|
|
+ $this->response()->write($response . PHP_EOL);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * TODO 待测 5.2 批量查询协议价价格
|
|
|
+ * HTTPS请求方式:POST
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ function skuPrice()
|
|
|
+ {
|
|
|
+
|
|
|
+ $data = $this->request()->getRequestParam();
|
|
|
+
|
|
|
+ $skuArr = $data['skuArr'];
|
|
|
+
|
|
|
+ $this->JdSdk = new JdSdk();
|
|
|
+
|
|
|
+ $response = $this->JdSdk->api_price_get_price($skuArr);
|
|
|
+
|
|
|
+ $this->response()->write($response . PHP_EOL);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
function test()
|
|
|
{
|
|
|
$this->response()->write('this is test');
|