From 95b370a8e790f5737827ce18cb4fa243ec332a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Wed, 18 Nov 2020 16:30:55 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BE=A0=E5=BC=80=E6=94=BE=E5=B9=B3=E5=8F=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 + composer.json | 2 +- src/common.php | 2 +- src/service/dingdanxia/DingDanXiaService.php | 108 +++++++++++++++++++ 4 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 src/service/dingdanxia/DingDanXiaService.php diff --git a/CHANGELOG.md b/CHANGELOG.md index aeaef07..c8e9d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v6.0.122 / 2020-11-28 +- 增加订单侠开放平台接口 + ## v6.0.121 / 2020-11-12 - 修复缴费平台接口 diff --git a/composer.json b/composer.json index b77c77d..5132533 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "qcloud/cos-sdk-v5": "^2.0", "qiniu/php-sdk": "^7.2", "upyun/sdk": "^3.4", - "phpoffice/phpspreadsheet": "1.12.0" + "phpoffice/phpspreadsheet": "^1.14" }, "require-dev": { "symfony/var-dumper": "^4.2" diff --git a/src/common.php b/src/common.php index f5aae31..50e2f7f 100644 --- a/src/common.php +++ b/src/common.php @@ -25,7 +25,7 @@ use DtApp\ThinkLibrary\service\SystemService; /** * 定义当前版本 */ -const VERSION = '6.0.121'; +const VERSION = '6.0.122'; if (!function_exists('get_ip_info')) { /** diff --git a/src/service/dingdanxia/DingDanXiaService.php b/src/service/dingdanxia/DingDanXiaService.php new file mode 100644 index 0000000..a5a4df3 --- /dev/null +++ b/src/service/dingdanxia/DingDanXiaService.php @@ -0,0 +1,108 @@ +app_key = $appKey; + return $this; + } + + /** + * 自定义接口 + * @param string $method + * @return $this + */ + public function setMethod($method = ''): self + { + $this->method = $method; + return $this; + } + + /** + * 请求参数 + * @param array $param + * @return $this + */ + public function param(array $param): self + { + $this->param = $param; + return $this; + } + + /** + * 获取配置信息 + * @return $this + */ + private function getConfig(): self + { + $this->app_key = config('dtapp.dingdanxia.app_key'); + return $this; + } + + /** + * 返回Array + * @return array|mixed + * @throws DtaException + */ + public function toArray() + { + //首先检测是否支持curl + if (!extension_loaded("curl")) { + throw new HttpException(404, '请开启curl模块!'); + } + if (empty($this->app_key)) { + $this->getConfig(); + } + if (empty($this->method)) { + throw new DtaException('请检查接口'); + } + $this->output = HttpService::instance() + ->url($this->method) + ->data($this->param) + ->post() + ->toArray(); + return $this->output; + } +} \ No newline at end of file -- GitLab