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