From bf09ec7935d85c68b51fbb0aa342e2671da5fc8b Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Thu, 29 Feb 2024 17:26:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=9F=E6=88=90=E5=95=86?= =?UTF-8?q?=E6=88=B7=E7=BA=BF=E4=B8=8B=E6=94=B6=E6=AC=BE=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/order/ScanPay.php | 12 +++++++++++- route/api.php | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controller/api/store/order/ScanPay.php b/app/controller/api/store/order/ScanPay.php index 2e7ef030..b0ff677b 100644 --- a/app/controller/api/store/order/ScanPay.php +++ b/app/controller/api/store/order/ScanPay.php @@ -4,6 +4,7 @@ namespace app\controller\api\store\order; use app\common\model\store\product\Product; use app\common\repositories\store\product\ProductRepository; +use app\controller\api\Common; use crmeb\basic\BaseController; /** @@ -26,10 +27,19 @@ class ScanPay extends BaseController $productRepo = app()->make(ProductRepository::class); $productRepo->force = true; $data = $productRepo->detail((int)$product['product_id'], $this->request->userInfo, $param['product_type']); - if (!$data){ + if (!$data) { return app('json')->fail('商品已下架'); } return app('json')->success($data); } + public function qrcode() + { + $merId = $this->request->get('mer_id'); + $common = app()->make(Common::class); + $siteUrl = systemConfig('site_url'); + $data = $common->Qrcode(['code' => $siteUrl . 'pages/payment/get_payment?mer_id=' . $merId, 'id' => $this->request->uid]); + return app('json')->success(['url' => $data]); + } + } diff --git a/route/api.php b/route/api.php index fa2bab8e..68f330e6 100755 --- a/route/api.php +++ b/route/api.php @@ -48,6 +48,7 @@ Route::group('api/', function () { Route::group(function () { Route::get('scanPay/product', 'api.store.order.ScanPay/product'); + Route::get('scanPay/qrcode', 'api.store.order.ScanPay/qrcode'); Route::any('qrcode', 'api.user.User/qrcode'); Route::get('merchantRecord', 'api.user.User/merchantRecord');