From ad03e71f0f0fabe5263662d4eb1caa3db65cbbcf Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 28 Sep 2023 10:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=8C=E7=BB=B4=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 12 ++++++++++++ route/api.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index edd11cc2..4bc88cd9 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1496,4 +1496,16 @@ class Auth extends BaseController $data = $repository->getResult($type); return app('json')->success($data); } + + public function merlogisticsCode($mer_id, $id) + { + $storeInfo = Db::name('store_service')->where('mer_id', $mer_id)->find(); + if (!$storeInfo) + return app('json')->fail('商户信息有误'); + $make = app()->make(StoreOrderRepository::class); + $order = $make->getWhere(['order_id' => $id, 'mer_id' => $storeInfo['mer_id'], 'is_del' => 0]); + if (!$order) + return app('json')->fail('订单状态有误'); + return app('json')->success(['qrcode' => $make->logisticsQrcode($id, $order->order_sn)]); + } } diff --git a/route/api.php b/route/api.php index 869f974a..cfa8b157 100644 --- a/route/api.php +++ b/route/api.php @@ -21,7 +21,7 @@ use think\facade\Route; Route::group('api/', function () { Route::any('test', 'api.Auth/test'); - Route::any('app/version', 'api.Auth/appVersion'); + Route::get('mer/:mer_id/logistics_code/:id', 'api.Auth/merlogisticsCode'); Route::any('dotest', 'api.Auth/dotest'); Route::post('merchant/syncStatus/:id', 'api.Auth/merchantStatus'); Route::get('business/agree', 'api.Auth/businessAgree');