更新收货码

This commit is contained in:
yaooo 2023-09-28 15:03:37 +08:00
parent eb09c262f9
commit 7003875c50
4 changed files with 19 additions and 13 deletions

View File

@ -1511,16 +1511,4 @@ 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)]);
}
}

View File

@ -375,6 +375,21 @@ class Order extends BaseController
return app('json')->success($this->repository->express($id, $this->request->merId()));
}
/**
* 设置取货码
*/
public function qrcode($id)
{
$storeInfo = Db::name('store_service')->where('mer_id', $this->request->merId())->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)]);
}
/**
* TODO
* @param $id

View File

@ -21,7 +21,6 @@ use think\facade\Route;
Route::group('api/', function () {
Route::any('test', 'api.Auth/test');
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');

View File

@ -52,6 +52,10 @@ Route::group(function () {
'_alias' => '列表',
]);
Route::get('qrcode/:id', 'Order/qrcode')->name('merchantStoreOrderQrcode')->option([
'_alias' => '订单收货码',
]);
Route::get('express/:id', 'Order/express')->name('merchantStoreOrderExpress')->option([
'_alias' => '快递查询',
]);