Skip to content

Commit eaab707

Browse files
Player626RunsTp
authored andcommitted
fix: qrcode create expire_seconds
1 parent 1a9044f commit eaab707

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Bean/OfficialAccount/QrCodeRequest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ public function buildRequest(): array
129129
$this->action_info = [
130130
'scene' => $scene
131131
];
132-
return parent::toArray(['action_name', 'action_info']);
132+
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+
141+
return parent::toArray($columns);
133142
}
134143
}

0 commit comments

Comments
 (0)