| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\workerapi\logic;
- use app\common\logic\BaseLogic;
- use app\common\service\wechat\WeChatConfigService;
- use app\common\service\wechat\WeChatMnpService;
- use EasyWeChat\MiniApp\Application;
- /**
- * 服务商品逻辑处理
- * Class GoodsCategoryLogic
- * @package app\workerapi\logic
- */
- class GoodsCategoryLogic extends BaseLogic
- {
- /**
- * @return \EasyWeChat\Kernel\HttpClient\Response|false|\Symfony\Contracts\HttpClient\ResponseInterface
- */
- public static function getQRCode()
- {
- try {
- $config = WeChatConfigService::getMnpConfig();
- $app = new Application($config);
- $response = $app->getClient()->postJson('/wxa/getwxacodeunlimit', [
- 'scene' => 'type=2&id=19',
- 'page' => '/pages/good/good',
- 'width' => 430,
- 'check_path' => false,
- 'env_vesion' => 'trial'
- ]);
- dd($response);
- } catch (\Throwable $e) {
- // 失败
- echo $e->getMessage();
- }
- }
- }
|