Browse Source

update: add inventory limit

tokumeikoi 2 years ago
parent
commit
cc6b07d7b8
3 changed files with 13 additions and 7 deletions
  1. 4 2
      app/Http/Requests/Admin/PlanSave.php
  2. 6 5
      database/install.sql
  3. 3 0
      database/update.sql

+ 4 - 2
app/Http/Requests/Admin/PlanSave.php

@@ -26,7 +26,8 @@ class PlanSave extends FormRequest
             'three_year_price' => 'nullable|integer',
             'onetime_price' => 'nullable|integer',
             'reset_price' => 'nullable|integer',
-            'reset_traffic_method' => 'nullable|integer|in:0,1,2,3,4'
+            'reset_traffic_method' => 'nullable|integer|in:0,1,2,3,4',
+            'inventory_limit' => 'nullable|integer'
         ];
     }
 
@@ -47,7 +48,8 @@ class PlanSave extends FormRequest
             'onetime_price.integer' => '一次性金额有误',
             'reset_price.integer' => '流量重置包金额有误',
             'reset_traffic_method.integer' => '流量重置方式格式有误',
-            'reset_traffic_method.in' => '流量重置方式格式有误'
+            'reset_traffic_method.in' => '流量重置方式格式有误',
+            'inventory_limit.integer' => '库存限制格式有误'
         ];
     }
 }

+ 6 - 5
database/install.sql

@@ -84,10 +84,10 @@ CREATE TABLE `v2_knowledge` (
 DROP TABLE IF EXISTS `v2_mail_log`;
 CREATE TABLE `v2_mail_log` (
                                `id` int(11) NOT NULL AUTO_INCREMENT,
-                               `email` varchar(64) CHARACTER SET utf8 NOT NULL,
-                               `subject` varchar(255) CHARACTER SET utf8 NOT NULL,
-                               `template_name` varchar(255) CHARACTER SET utf8 NOT NULL,
-                               `error` text CHARACTER SET utf8,
+                               `email` varchar(64) NOT NULL,
+                               `subject` varchar(255) NOT NULL,
+                               `template_name` varchar(255) NOT NULL,
+                               `error` text,
                                `created_at` int(11) NOT NULL,
                                `updated_at` int(11) NOT NULL,
                                PRIMARY KEY (`id`)
@@ -176,6 +176,7 @@ CREATE TABLE `v2_plan` (
                            `onetime_price` int(11) DEFAULT NULL,
                            `reset_price` int(11) DEFAULT NULL,
                            `reset_traffic_method` tinyint(1) DEFAULT NULL,
+                           `inventory_limit` int(11) DEFAULT NULL,
                            `created_at` int(11) NOT NULL,
                            `updated_at` int(11) NOT NULL,
                            PRIMARY KEY (`id`)
@@ -378,4 +379,4 @@ CREATE TABLE `v2_user` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
--- 2022-06-10 17:12:02
+-- 2022-06-28 18:09:08

+ 3 - 0
database/update.sql

@@ -586,3 +586,6 @@ ALTER TABLE `v2_mail_log`
     CHANGE `subject` `subject` varchar(255) NOT NULL AFTER `email`,
     CHANGE `template_name` `template_name` varchar(255) NOT NULL AFTER `subject`,
     CHANGE `error` `error` text NULL AFTER `template_name`;
+
+ALTER TABLE `v2_plan`
+    ADD `inventory_limit` int(11) NULL AFTER `reset_traffic_method`;