| @@ 49-62 (lines=14) @@ | ||
| 46 | * |
|
| 47 | * @return \EasyWeChat\Support\Collection |
|
| 48 | */ |
|
| 49 | public function forever($sceneValue) |
|
| 50 | { |
|
| 51 | if (is_int($sceneValue) && $sceneValue > 0 && $sceneValue < self::SCENE_MAX_VALUE) { |
|
| 52 | $type = self::SCENE_QR_FOREVER; |
|
| 53 | $sceneKey = 'scene_id'; |
|
| 54 | } else { |
|
| 55 | $type = self::SCENE_QR_FOREVER_STR; |
|
| 56 | $sceneKey = 'scene_str'; |
|
| 57 | } |
|
| 58 | ||
| 59 | $scene = [$sceneKey => $sceneValue]; |
|
| 60 | ||
| 61 | return $this->create($type, $scene, false); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * Create temporary. |
|
| @@ 72-85 (lines=14) @@ | ||
| 69 | * |
|
| 70 | * @return \EasyWeChat\Support\Collection |
|
| 71 | */ |
|
| 72 | public function temporary($sceneValue, $expireSeconds = null) |
|
| 73 | { |
|
| 74 | if (is_int($sceneValue) && $sceneValue > 0) { |
|
| 75 | $type = self::SCENE_QR_TEMPORARY; |
|
| 76 | $sceneKey = 'scene_id'; |
|
| 77 | } else { |
|
| 78 | $type = self::SCENE_QR_TEMPORARY_STR; |
|
| 79 | $sceneKey = 'scene_str'; |
|
| 80 | } |
|
| 81 | ||
| 82 | $scene = [$sceneKey => $sceneValue]; |
|
| 83 | ||
| 84 | return $this->create($type, $scene, true, $expireSeconds); |
|
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| 88 | * Create QRCode for card. |
|