File tree Expand file tree Collapse file tree 4 files changed +113
-2
lines changed Expand file tree Collapse file tree 4 files changed +113
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## v6.0.122 / 2020-11-28
2
+ - 增加订单侠开放平台接口
3
+
1
4
## v6.0.121 / 2020-11-12
2
5
- 修复缴费平台接口
3
6
Original file line number Diff line number Diff line change 40
40
"qcloud/cos-sdk-v5" : " ^2.0" ,
41
41
"qiniu/php-sdk" : " ^7.2" ,
42
42
"upyun/sdk" : " ^3.4" ,
43
- "phpoffice/phpspreadsheet" : " 1.12.0 "
43
+ "phpoffice/phpspreadsheet" : " ^1.14 "
44
44
},
45
45
"require-dev" : {
46
46
"symfony/var-dumper" : " ^4.2"
Original file line number Diff line number Diff line change 25
25
/**
26
26
* 定义当前版本
27
27
*/
28
- const VERSION = '6.0.121 ' ;
28
+ const VERSION = '6.0.122 ' ;
29
29
30
30
if (!function_exists ('get_ip_info ' )) {
31
31
/**
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace DtApp \ThinkLibrary \service \dingdanxia ;
4
+
5
+ use DtApp \ThinkLibrary \exception \DtaException ;
6
+ use DtApp \ThinkLibrary \Service ;
7
+ use DtApp \ThinkLibrary \service \curl \HttpService ;
8
+ use think \exception \HttpException ;
9
+
10
+ /**
11
+ * 订单侠开放平台
12
+ * Class DingDanXiaService
13
+ * @package DtApp\ThinkLibrary\service\dingdanxia
14
+ */
15
+ class DingDanXiaService extends Service
16
+ {
17
+ /**
18
+ * 接口秘钥
19
+ * @var string
20
+ */
21
+ private $ app_key ;
22
+
23
+ /**
24
+ * API接口
25
+ * @var string
26
+ */
27
+ private $ method ;
28
+
29
+ /**
30
+ * 需要发送的的参数
31
+ * @var
32
+ */
33
+ private $ param ;
34
+
35
+ /**
36
+ * 响应内容
37
+ * @var
38
+ */
39
+ private $ output ;
40
+
41
+ /**
42
+ * 接口秘钥,请登录后台获取
43
+ * @param string $appKey
44
+ * @return $this
45
+ */
46
+ public function appKey (string $ appKey ): self
47
+ {
48
+ $ this ->app_key = $ appKey ;
49
+ return $ this ;
50
+ }
51
+
52
+ /**
53
+ * 自定义接口
54
+ * @param string $method
55
+ * @return $this
56
+ */
57
+ public function setMethod ($ method = '' ): self
58
+ {
59
+ $ this ->method = $ method ;
60
+ return $ this ;
61
+ }
62
+
63
+ /**
64
+ * 请求参数
65
+ * @param array $param
66
+ * @return $this
67
+ */
68
+ public function param (array $ param ): self
69
+ {
70
+ $ this ->param = $ param ;
71
+ return $ this ;
72
+ }
73
+
74
+ /**
75
+ * 获取配置信息
76
+ * @return $this
77
+ */
78
+ private function getConfig (): self
79
+ {
80
+ $ this ->app_key = config ('dtapp.dingdanxia.app_key ' );
81
+ return $ this ;
82
+ }
83
+
84
+ /**
85
+ * 返回Array
86
+ * @return array|mixed
87
+ * @throws DtaException
88
+ */
89
+ public function toArray ()
90
+ {
91
+ //首先检测是否支持curl
92
+ if (!extension_loaded ("curl " )) {
93
+ throw new HttpException (404 , '请开启curl模块! ' );
94
+ }
95
+ if (empty ($ this ->app_key )) {
96
+ $ this ->getConfig ();
97
+ }
98
+ if (empty ($ this ->method )) {
99
+ throw new DtaException ('请检查接口 ' );
100
+ }
101
+ $ this ->output = HttpService::instance ()
102
+ ->url ($ this ->method )
103
+ ->data ($ this ->param )
104
+ ->post ()
105
+ ->toArray ();
106
+ return $ this ->output ;
107
+ }
108
+ }
You can’t perform that action at this time.
0 commit comments