瀏覽代碼

feat(basic-service): 修改查询店铺信息方法支持可选参数

runphp 6 月之前
父節點
當前提交
9202f21afd
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/Services/BasicService.php

+ 6 - 4
src/Services/BasicService.php

@@ -14,11 +14,13 @@ class BasicService extends BaseService
     /**
      * Query shop information
      */
-    public function queryShop(string $shopNo): ApiResponse
+    public function queryShop(?string $shopNo = null): ApiResponse
     {
-        return $this->call('shop.php', [
-            'shop_no' => $shopNo,
-        ]);
+        $params = [];
+        if ($shopNo !== null) {
+            $params['shop_no'] = $shopNo;
+        }
+        return $this->call('shop.php', $params);
     }
 
     /**