调整接口

This commit is contained in:
2023-01-17 16:53:57 +08:00
parent 59ffc94546
commit 8dc003eb8a
7 changed files with 43 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ class AreaCodeController extends Controller
return $this->failed('缺少提货码');
}
$areaCode = AreaCode::query()->where('code', $code)->first();
if ($areaCode->status != AreaCode::STATUS_INIT) {
if ($areaCode->status != AreaCode::STATUS_USED) {
return $this->failed('此提货码已提货');
}
try {

View File

@@ -19,7 +19,13 @@ Route::group([
'middleware' => config('api.route.middleware_auth'),
], function (Router $router) {
$router->get('areas/{code}/show', 'AreaCodeController@show');
$router->get('areas/code/info', 'AreaCodeController@info');
$router->post('areas/code/{code}/verify', 'AreaCodeController@verify');
});
Route::group([
'namespace' => 'Area',
'middleware' => config('api.route.middleware_guess'),
], function (Router $router) {
$router->get('areas/code/info', 'AreaCodeController@info');
});