diff --git a/app/Admin/Controllers/PersonChangeController.php b/app/Admin/Controllers/PersonChangeController.php index ec46c51..038d640 100644 --- a/app/Admin/Controllers/PersonChangeController.php +++ b/app/Admin/Controllers/PersonChangeController.php @@ -2,6 +2,7 @@ namespace App\Admin\Controllers; +use App\Models\PersonChange; use Slowlyo\OwlAdmin\Admin; use Slowlyo\OwlAdmin\Renderers\Page; use Slowlyo\OwlAdmin\Renderers\Form; @@ -29,10 +30,12 @@ class PersonChangeController extends AdminController ])) ->columns([ amis()->TableColumn('person.organized_body.name', __('admin.persons.organized_body'))->width('100px'), + amis()->TableColumn('changed_at', __('admin.person_changes.changed_at'))->width('100px'), + amis()->TableColumn('type', __('admin.person_changes.type'))->type('mapping')->map(PersonChange::typeMap()), amis()->TableColumn('person.name', __('admin.persons.name'))->width('100px')->copyable(), amis()->TableColumn('extends_mark', __('admin.person_changes.extends_mark')), amis()->TableColumn('phone', __('admin.person_changes.phone')), - amis()->TableColumn('created_at', __('admin.created_at'))->type('datetime')->sortable(true), + amis()->TableColumn('created_at', __('admin.person_changes.created_at'))->type('datetime')->sortable(true), ]); return $this->baseList($crud); diff --git a/database/migrations/2024_02_21_174024_create_person_changes_table.php b/database/migrations/2024_02_21_174024_create_person_changes_table.php index ed30297..e82fc5c 100644 --- a/database/migrations/2024_02_21_174024_create_person_changes_table.php +++ b/database/migrations/2024_02_21_174024_create_person_changes_table.php @@ -15,7 +15,7 @@ return new class extends Migration $table->id(); $table->unsignedBigInteger('person_id'); $table->unsignedTinyInteger('type')->comment('变动类型(1-迁入,2-出生,3-迁出(迁出本村),4-死亡,5-合户,6-分户,7-迁移(内部变动),8-更换户主)'); - $table->timestamp('changed_at')->nullable()->comment('发生时间'); + $table->date('changed_at')->nullable()->comment('发生时间'); $table->string('reason')->nullable()->comment('原因'); $table->unsignedBigInteger('old_master')->nullable()->comment('老户主'); $table->unsignedBigInteger('new_master')->nullable()->comment('新户主'); diff --git a/lang/zh_CN/admin.php b/lang/zh_CN/admin.php index a757f31..c62e98a 100644 --- a/lang/zh_CN/admin.php +++ b/lang/zh_CN/admin.php @@ -380,7 +380,10 @@ return [ 'split_master' => '分户', ], 'person_changes'=>[ + 'changed_at' => '变动日期', 'extends_mark'=>'变动明细', - 'phone'=>'联系方式' + 'type' => '类别', + 'phone'=>'联系方式', + 'created_at' => '操作时间' ] ];