first commit

master
cody 11 months ago
parent 3a1db90555
commit 6bf8f5bb14

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateConfigsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('configs', function (Blueprint $table) {
$table->comment('系统配置');
$table->increments('id');
$table->string('name')->comment('名字');
$table->string('key')->comment('标示');
$table->mediumText('value')->comment('值')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('configs');
}
}

@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVisitTimesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('visit_times', function (Blueprint $table) {
$table->comment('访问时段配置');
$table->increments('id');
$table->string('start_time',50)->comment('开始时间')->nullable();
$table->string('end_time',50)->comment('结束时间')->nullable();
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('visit_times');
}
}

@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('studies', function (Blueprint $table) {
$table->comment('学习内容表');
$table->increments('id');
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->string('name')->comment('名称');
$table->integer('expire_day')->comment('有效天数')->nullable();
$table->integer('minute')->comment('最低学习分钟数')->nullable();
$table->decimal('rate')->comment('通过正确率')->nullable();
$table->mediumText('content')->comment('内容')->nullable();
$table->json('file')->comment('文件id数组')->nullable();
$table->string('type')->default('1')->comment('类型1访客2施工3车辆')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('studies');
}
}

@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudyAsksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('study_asks', function (Blueprint $table) {
$table->comment('学习问答表');
$table->increments('id');
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->integer('study_id')->comment('资料id');
$table->string('title')->comment('问题内容');
$table->boolean('type')->comment('类型1单选2多选');
$table->json('answer')->comment('回答选项二维数组包括content答案内容result是否正确0错误1正确')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('study_asks');
}
}

@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVisitAreasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('visit_areas', function (Blueprint $table) {
$table->comment('访问区域');
$table->increments('id');
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->string('name')->comment('名字');
$table->integer('audit_type')->comment('审核类型1-3')->nullable();
$table->json('audit_admin')->comment('审核节点数组。包含admin_id字段上级审核填写0')->nullable();
$table->string('remark')->comment('备注')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('visit_areas');
}
}

@ -0,0 +1,66 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVisitsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('visits', function (Blueprint $table) {
$table->comment('访问申请');
$table->increments('id');
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->date('date')->comment('到访日期');
$table->integer('visit_time_id')->comment('时间段id')->nullable();
$table->integer('visit_area_id')->comment('区域id')->nullable();
$table->string('reason')->comment('事由')->nullable();
$table->string('remark')->comment('备注')->nullable();
$table->string('name')->comment('名字')->nullable();
$table->string('mobile')->comment('电话')->nullable();
$table->boolean('credent')->comment('证件类型1身份证2护照')->nullable();
$table->string('idcard')->comment('证件号码')->nullable();
$table->string('company_name')->comment('单位名称')->nullable();
$table->json('follw_people')->comment('随访人员')->nullable();
$table->json('cars')->comment('到访车辆')->nullable();
$table->date('start_date')->comment('开始时间')->nullable();
$table->date('end_date')->comment('结束时间')->nullable();
$table->integer('accpet_department_id')->comment('接待部门')->nullable();
$table->integer('accept_admin_id')->comment('接待人员')->nullable();
$table->string('plate')->comment('车牌号')->nullable();
$table->string('type')->default('1')->comment('类型1访客2访客车辆3物流车辆')->nullable();
$table->boolean('long_time')->comment('是否长期0否1是')->nullable();
$table->boolean('audit_status')->comment('审核状态-1待学习0待审核1通过(待进厂)2驳回3已进厂4已离厂')->nullable()->default(0);
$table->integer('user_id')->comment('用户id')->nullable();
$table->string('code')->comment('编号')->nullable();
$table->string('accept_admin_sign')->comment('被访人签字图片id')->nullable();
$table->json('file')->nullable()->comment('附件id数组');
$table->string('accept_goods_admin_id')->comment('收货人id')->nullable();
$table->date('work_start_time')->comment('施工开始时间')->nullable();
$table->date('work_end_time')->comment('施工结束时间')->nullable();
$table->string('car_no')->nullable()->comment('停车牌');
$table->string('person_no')->nullable()->comment('人牌');
$table->string('cda')->nullable();
$table->integer('accompany_id')->nullable()->comment('陪同人id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('visits');
}
}

@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVisitAuditsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('visit_audits', function (Blueprint $table) {
$table->comment('访问审核');
$table->increments('id');
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->integer('visit_id')->comment('参观id');
$table->integer('audit_admin_id')->comment('审核人员id');
$table->integer('status')->comment('状态0待审核1通过2驳回')->nullable();
$table->string('reason')->comment('原因')->nullable();
$table->boolean('level')->comment('等级')->nullable()->default(1);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('visit_audits');
}
}

@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBlacklistsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('blacklists', function (Blueprint $table) {
$table->comment('黑名单');
$table->increments('id');
$table->integer('admin_id')->comment('不用填')->nullable();
$table->integer('department_id')->comment('不用填')->nullable();
$table->string('name')->comment('名字')->nullable();
$table->string('mobile')->comment('手机号')->nullable();
$table->integer('credent')->comment('证件类型1身份证2护照')->nullable();
$table->string('idcard')->comment('证件号')->nullable();
$table->date('start_date')->comment('开始时间')->nullable();
$table->date('end_date')->comment('结束时间')->nullable();
$table->boolean('status')->default('1')->comment('状态0禁用1启用')->nullable();
$table->string('remark')->nullable()->comment('备注');
$table->string('company_name')->nullable()->comment('单位名字');
$table->json('file')->nullable()->comment('附件');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('blacklists');
}
}

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateGateLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('gate_logs', function (Blueprint $table) {
$table->comment('门岗扫码记录');
$table->increments('id');
$table->integer('admin_id')->nullable();
$table->string('code', 50)->nullable();
$table->string('remark')->nullable();
$table->dateTime('created_at')->nullable();
$table->dateTime('updated_at')->nullable();
$table->json('person_no')->nullable()->comment('人牌');
$table->json('car_no')->nullable()->comment('车牌');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('gate_logs');
}
}

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVisitLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('visit_logs', function (Blueprint $table) {
$table->comment('访问日志');
$table->increments('id');
$table->integer('admin_id')->nullable();
$table->integer('department_id')->nullable();
$table->integer('user_id')->nullable();
$table->integer('visit_id')->nullable();
$table->string('remark')->nullable();
$table->dateTime('created_at')->nullable();
$table->dateTime('updated_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('visit_logs');
}
}

@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStudyLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('study_logs', function (Blueprint $table) {
$table->comment('学习记录表');
$table->increments('id');
$table->integer('admin_id')->nullable()->comment('不用填');
$table->integer('department_id')->nullable()->comment('不用填');
$table->integer('user_id');
$table->json('content')->nullable();
$table->json('ask')->nullable();
$table->integer('expire_day')->comment('有效天数')->nullable();
$table->boolean('type')->comment('类型')->nullable();
$table->string('name')->comment('姓名')->nullable();
$table->string('mobile')->comment('手机号')->nullable();
$table->string('idcard')->comment('身份证号')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('study_logs');
}
}
Loading…
Cancel
Save