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');