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) { + // + }); + } +};