From 0ba4005f01708a1ae207be440a07cb9ac3932332 Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 19 Jun 2020 10:55:41 +0800 Subject: [PATCH] Update Keys.php --- app/wechat/controller/Keys.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/wechat/controller/Keys.php b/app/wechat/controller/Keys.php index ca84be383..66d5d2a2f 100644 --- a/app/wechat/controller/Keys.php +++ b/app/wechat/controller/Keys.php @@ -52,18 +52,16 @@ class Keys extends Controller public function index() { // 关键字二维码生成 - if ($this->request->get('action') === 'qrc') { - try { - $wechat = WechatService::WeChatQrcode(); - $result = $wechat->create($this->request->get('keys', '')); - $this->success('生成二维码成功!', "javascript:$.previewImage('{$wechat->url($result['ticket'])}')"); - } catch (HttpResponseException $exception) { - throw $exception; - } catch (\Exception $exception) { - $this->error("生成二维码失败,请稍候再试!
{$exception->getMessage()}"); - } + if ($this->request->get('action') === 'qrc') try { + $wechat = WechatService::WeChatQrcode(); + $result = $wechat->create($this->request->get('keys', '')); + $this->success('生成二维码成功!', "javascript:$.previewImage('{$wechat->url($result['ticket'])}')"); + } catch (HttpResponseException $exception) { + throw $exception; + } catch (\Exception $exception) { + $this->error("生成二维码失败,请稍候再试!
{$exception->getMessage()}"); } - // 关键字列表显示 + // 数据列表分页处理 $this->title = '回复规则管理'; $query = $this->_query($this->table)->like('keys,type')->equal('status')->dateBetween('create_at'); $query->whereNotIn('keys', ['subscribe', 'default'])->order('sort desc,id desc')->page();