From 2b7fcc998a3a0eaf22fae269f4cc012a443e4ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Sat, 27 Jan 2024 19:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=87=8D=E7=BD=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Shop/ShopsController.php | 12 +++++++ app/Models/DeveloperConfig.php | 12 +++++++ ..._111436_create_developer_configs_table.php | 36 +++++++++++++++++++ resources/lang/zh-CN/permission.php | 5 +++ 4 files changed, 65 insertions(+) create mode 100644 app/Models/DeveloperConfig.php create mode 100644 database/migrations/2024_01_27_111436_create_developer_configs_table.php diff --git a/app/Http/Controllers/Shop/ShopsController.php b/app/Http/Controllers/Shop/ShopsController.php index 1688b6a..fdc64e2 100644 --- a/app/Http/Controllers/Shop/ShopsController.php +++ b/app/Http/Controllers/Shop/ShopsController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Shop; use App\Http\Controllers\Controller; use App\Models\BusinessGoodsSku; +use App\Models\DeveloperConfig; use App\Models\GoodsSku; use App\Models\Shop; use App\Http\Resources\ShopsResource; @@ -255,4 +256,15 @@ class ShopsController extends Controller } } } + + public function orderReset(Request $request) + { + DeveloperConfig::query()->updateOrCreate([ + 'key' => DeveloperConfig::$ORDER_RESET_TIME, + ], [ + 'value' => date('Y-m-d H:i:s') + ]); + + return response($this->res, $this->res['httpCode']); + } } diff --git a/app/Models/DeveloperConfig.php b/app/Models/DeveloperConfig.php new file mode 100644 index 0000000..78feac9 --- /dev/null +++ b/app/Models/DeveloperConfig.php @@ -0,0 +1,12 @@ +bigIncrements('id'); + $table->string('key')->comment('配置项名称'); + $table->string('value')->comment('配置项值'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('developer_configs'); + } +} diff --git a/resources/lang/zh-CN/permission.php b/resources/lang/zh-CN/permission.php index 5bb012b..e454be0 100644 --- a/resources/lang/zh-CN/permission.php +++ b/resources/lang/zh-CN/permission.php @@ -70,6 +70,11 @@ return [ 'name' => '上新导入', 'parent_id' => 2, ], + 'order.reset_count' => [ + 'id' => 201, + 'name' => '订单重置', + 'parent_id' => 2, + ], // 商品种类 'GOODS_TYPE' => [ 'id' => 3,