Skip to content

Commit dac28e6

Browse files
Player626RunsTp
authored andcommitted
fix: qrcode
1 parent eaab707 commit dac28e6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Bean/OfficialAccount/QrCodeRequest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,15 @@ public function buildRequest(): array
113113
$this->action_info = json_decode($this->action_info, true);
114114
}
115115

116+
$columns = ['action_name', 'action_info'];
117+
118+
if (!is_null($this->expire_seconds) && is_numeric($this->expire_seconds)) {
119+
$this->expire_seconds = min($this->expire_seconds, 30 * 86400);
120+
array_push($columns,'expire_seconds');
121+
}
122+
116123
if (!is_null($this->getActionInfo())) {
117-
return parent::toArray(['action_name', 'action_info']);
124+
return parent::toArray($columns);
118125
}
119126

120127
$scene = [];
@@ -130,14 +137,6 @@ public function buildRequest(): array
130137
'scene' => $scene
131138
];
132139

133-
134-
$columns = ['action_name', 'action_info'];
135-
136-
if (!is_null($this->expire_seconds) && is_numeric($this->expire_seconds)) {
137-
$this->expire_seconds = min($this->expire_seconds, 30 * 86400);
138-
array_push($columns,'expire_seconds');
139-
}
140-
141140
return parent::toArray($columns);
142141
}
143142
}

0 commit comments

Comments
 (0)