From 6499a6a6a23a596a41d8f2391794a8ca7ead358a Mon Sep 17 00:00:00 2001 From: liyinglin Date: Mon, 10 Apr 2023 13:26:33 +0800 Subject: [PATCH] 1 --- app/Models/GateLog.php | 5 +++ ...023_04_10_132436_alert_gate_logs_table.php | 34 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 database/migrations/2023_04_10_132436_alert_gate_logs_table.php diff --git a/app/Models/GateLog.php b/app/Models/GateLog.php index 866e119..07caf72 100644 --- a/app/Models/GateLog.php +++ b/app/Models/GateLog.php @@ -6,6 +6,11 @@ class GateLog extends SoftDeletesModel { protected $guarded = ['id']; + protected $casts = [ + 'person_no'=>'array', + 'car_no'=>'array' + ]; + public static function add($admin_id, $code = '', $remark = '') { return self::create([ diff --git a/database/migrations/2023_04_10_132436_alert_gate_logs_table.php b/database/migrations/2023_04_10_132436_alert_gate_logs_table.php new file mode 100644 index 0000000..c01e933 --- /dev/null +++ b/database/migrations/2023_04_10_132436_alert_gate_logs_table.php @@ -0,0 +1,34 @@ +json('person_no')->nullable()->comment('人牌'); + $table->json('car_no')->nullable()->comment('车牌'); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('gate_logs', function (Blueprint $table) { + // + }); + } +};