From 97114bbca84b97291cf4e03abc9672194a5ab19e Mon Sep 17 00:00:00 2001 From: Jing Li Date: Mon, 7 Nov 2022 13:46:02 +0800 Subject: [PATCH] Update --- app/Http/Requestes/RiceShrimpPriceStoreRequest.php | 2 +- app/Http/Requestes/RiceShrimpPriceUpdateRequest.php | 2 +- .../2022_11_01_133147_create_rice_shrimp_prices_table.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Requestes/RiceShrimpPriceStoreRequest.php b/app/Http/Requestes/RiceShrimpPriceStoreRequest.php index 0647ec6..bd3d094 100644 --- a/app/Http/Requestes/RiceShrimpPriceStoreRequest.php +++ b/app/Http/Requestes/RiceShrimpPriceStoreRequest.php @@ -17,7 +17,7 @@ class RiceShrimpPriceStoreRequest extends FormRequest return [ 'year' => ['required', 'int'], 'quarter' => ['required', new Quarter()], - 'price' => ['required', 'regex:/^([1-9]\d*|0)(\.\d{1,2})?$/'], + 'price' => ['required', 'int'], ]; } diff --git a/app/Http/Requestes/RiceShrimpPriceUpdateRequest.php b/app/Http/Requestes/RiceShrimpPriceUpdateRequest.php index 211414f..ae835eb 100644 --- a/app/Http/Requestes/RiceShrimpPriceUpdateRequest.php +++ b/app/Http/Requestes/RiceShrimpPriceUpdateRequest.php @@ -17,7 +17,7 @@ class RiceShrimpPriceUpdateRequest extends FormRequest return [ 'year' => ['filled', 'int'], 'quarter' => ['filled', new Quarter()], - 'price' => ['filled', 'regex:/^([1-9]\d*|0)(\.\d{1,2})?$/'], + 'price' => ['filled', 'int'], ]; } diff --git a/database/migrations/2022_11_01_133147_create_rice_shrimp_prices_table.php b/database/migrations/2022_11_01_133147_create_rice_shrimp_prices_table.php index 1da700c..8f480d6 100644 --- a/database/migrations/2022_11_01_133147_create_rice_shrimp_prices_table.php +++ b/database/migrations/2022_11_01_133147_create_rice_shrimp_prices_table.php @@ -17,7 +17,7 @@ return new class extends Migration $table->id(); $table->integer('year')->comment('年'); $table->tinyInteger('quarter')->comment('季度'); - $table->decimal('price', 10, 2)->comment('价格'); + $table->unsignedBigInteger('price')->comment('价格'); $table->unsignedBigInteger('created_by')->comment('创建人ID'); $table->unsignedBigInteger('updated_by')->comment('修改人ID'); $table->timestamps();