예제 #1
0
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->string('name');
         $t->unsignedInteger('hospital_id');
         $t->unsignedInteger('department_id');
         $t->integer('cust_id')->unsigned()->unique();
         $t->string('title');
         $t->integer('level');
         $t->text('memo')->nullable();
         $t->string('wechat_id')->nullable();
         $t->string('phone')->nullable();
         $t->string('email')->nullable();
         $t->smallInteger('gender')->nullable()->default(1);
         $t->smallInteger('status')->default(1);
         $t->softDeletes();
         $t->timestamps();
         $t->foreign('hospital_id')->references('id')->on('i_hospital')->onDelete('cascade');
         $t->foreign('department_id')->references('id')->on('i_department')->onDelete('cascade');
     });
     $count = 1000;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['name' => str_random(2) . ' ' . str_random(2), 'department_id' => rand(1, 400), 'hospital_id' => rand(1, 400), 'cust_id' => 1000000 + $i, 'title' => str_random(10), 'level' => rand(1, 5), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(2) . '.com', 'status' => rand(1, 3), 'memo' => str_random(200)]);
     }
 }
예제 #2
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->text('name');
         $t->text('name_in_charge');
         $t->integer('city_id')->unsigned();
         $t->integer('province_id')->unsigned();
         $t->text('location_detail');
         $t->string('username')->unique();
         $t->string('password');
         $t->string('phone')->nullable();
         $t->string('email')->nullable();
         $t->date('started_at')->nullable();
         $t->date('ended_at')->nullable();
         $t->smallInteger('status')->default(1);
         // 0为冻结账户
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
     });
     $count = 1000;
     db_c($this->ins_name, 'i', ['id' => 1, 'name' => '自营', 'name_in_charge' => str_random(2) . ' ' . str_random(2), 'location_detail' => str_random(100), 'started_at' => date("Y-m-d H:i:s", 1440560208), 'ended_at' => date("Y-m-d H:i:s", 1840560208), 'city_id' => rand(36, 398), 'province_id' => rand(2, 35), 'username' => $this->ins_name . 'self', 'password' => hash_password($this->ins_name . 'self'), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200), 'status' => rand(0, 1)]);
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['name' => str_random(2) . '集团', 'name_in_charge' => str_random(2) . ' ' . str_random(2), 'location_detail' => str_random(100), 'started_at' => date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208)), 'ended_at' => date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208) + rand(1000000, 999999999)), 'city_id' => rand(36, 398), 'province_id' => rand(2, 35), 'username' => $this->ins_name . $i, 'password' => hash_password($this->ins_name . $i), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200), 'status' => rand(0, 1)]);
     }
 }
예제 #3
0
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->string('cust_id')->unique();
         $t->smallInteger('status')->default(1);
         $t->smallInteger('sold')->default(0);
         $t->unsignedInteger('replacement_id')->nullable();
         $t->unsignedInteger('doctor_id')->nullable();
         $t->unsignedInteger('agency_id');
         $t->unsignedInteger('hospital_id')->nullable();
         $t->unsignedInteger('robot_id')->nullable();
         $t->string('surgery_type')->nullable();
         $t->dateTime('surgery_at')->nullable();
         $t->unsignedInteger('patient_id')->nullable();
         $t->dateTime('sold_at')->nullable();
         $t->dateTime('used_at')->nullable();
         $t->dateTime('damaged_at')->nullable();
         $t->dateTime('archive_at')->nullable();
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
         //$t->foreign('replacement_id')->references('id')->on('i_mark');
         $t->foreign('doctor_id')->references('id')->on('i_doctor')->onDelete('cascade');
         $t->foreign('agency_id')->references('id')->on('i_agency')->onDelete('cascade');
         $t->foreign('hospital_id')->references('id')->on('i_hospital')->onDelete('cascade');
         $t->foreign('robot_id')->references('id')->on('i_robot')->onDelete('cascade');
     });
     $count = 3000;
     $d = [];
     function sold_at($used_at)
     {
         if ($used_at) {
             return date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208));
         }
         return null;
     }
     //function replacement_id()
     //{
     //    if ( ! empty($d['damaged_at']))
     //    {
     //        $rand_id = [null, rand(1, 3000)];
     //        return $rand_id[rand(0, count($rand_id) - 1)];
     //    }
     //    return null;
     //}
     for ($i = 0; $i < $count; $i++) {
         $status_set = [-1, 2, 3, 4];
         $sold_set = [0, 1];
         $rand_date = [null, date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208))];
         //$sold_date = date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208));
         //$damaged_at = [null, date($sold_date + rand(190000, 390000))];
         $d = ['cust_id' => uniqid(), 'status' => rand(1, 4), 'replacement_id' => rand(1, 3000), 'used_at' => $used_at = $rand_date[rand(0, count($rand_date) - 1)], 'sold_at' => sold_at($used_at), 'damaged_at' => $rand_date[rand(0, count($rand_date) - 1)], 'robot_id' => rand(1, 1000), 'agency_id' => rand(1, 1000), 'doctor_id' => rand(1, 500), 'hospital_id' => rand(1, 400), 'memo' => str_random(500)];
         db_c($this->ins_name, 'i', $d);
     }
 }
예제 #4
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->string('cust_id')->unique();
         $t->dateTime('production_date');
         $t->unsignedInteger('employee_id');
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
         $t->foreign('employee_id')->references('id')->on('i_employee')->onDelete('cascade');
     });
     $count = 1000;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['production_date' => \Carbon\Carbon::now(), 'cust_id' => uniqid(), 'employee_id' => rand(1, 100), 'memo' => str_random(500)]);
     }
 }
예제 #5
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->dateTime('at');
         $t->unsignedInteger('action_type_id');
         $t->unsignedInteger('ins_type_id');
         $t->unsignedInteger('related_id');
         $t->unsignedInteger('operator_type');
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
     });
     $count = 1000;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['at' => date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208)), 'action_type_id' => rand(1, 10), 'ins_type_id' => rand(1, 10), 'related_id' => rand(1, 1000), 'operator_type' => rand(1, 5), 'memo' => str_random(500)]);
     }
 }
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->string('name');
         $t->string('username')->unique();
         $t->string('password');
         $t->integer('hospital_id')->unsigned();
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
         $t->foreign('hospital_id')->references('id')->on('i_hospital')->onDelete('cascade');
     });
     $count = 400;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['name' => str_random(2) . $i . '科', 'username' => 'department' . $i, 'password' => hash_password('department' . $i), 'hospital_id' => rand(1, 400), 'memo' => str_random(200)]);
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->integer('action_type_id')->default(1);
         $t->unsignedInteger('robot_id');
         $t->unsignedInteger('employee_id');
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
         $t->foreign('robot_id')->references('id')->on('i_robot')->onDelete('cascade');
         $t->foreign('employee_id')->references('id')->on('i_employee')->onDelete('cascade');
     });
     $count = 1000;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['employee_id' => rand(1, 100), 'robot_id' => rand(1, 1000), 'action_type_id' => rand(1, 3), 'memo' => str_random(500)]);
     }
 }
예제 #8
0
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->text('name');
         $t->integer('city_id')->unsigned();
         $t->integer('province_id')->unsigned();
         $t->text('location_detail');
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
     });
     db_c($this->ins_name, 'i', ['name' => '自有', 'city_id' => rand(36, 398), 'province_id' => rand(2, 35), 'location_detail' => str_random(100), 'memo' => str_random(500)]);
     $count = 400;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['name' => str_random(2) . '第' . $i . '医院', 'city_id' => rand(36, 398), 'province_id' => rand(2, 35), 'location_detail' => str_random(100), 'memo' => str_random(500)]);
     }
 }
예제 #9
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->string('name');
         $t->string('username')->unique();
         $t->string('password');
         $t->string('phone')->nullable();
         $t->string('email')->nullable();
         $t->smallInteger('status')->default(1);
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
     });
     db_c($this->ins_name, 'i', ['name' => str_random(2) . ' ' . str_random(2), 'username' => 'admin', 'password' => hash_password('admin'), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200)]);
     $count = 100;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['name' => str_random(2) . ' ' . str_random(2), 'username' => $this->ins_name . $i, 'password' => hash_password($this->ins_name . $i), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200)]);
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('i_' . $this->ins_name, function (Blueprint $t) {
         $t->engine = 'InnoDB';
         $t->increments('id');
         $t->integer('lease_type_id')->default(1);
         $t->dateTime('lease_started_at');
         $t->dateTime('lease_ended_at');
         $t->unsignedInteger('robot_id');
         $t->unsignedInteger('agency_id');
         $t->unsignedInteger('hospital_id');
         $t->text('memo')->nullable();
         $t->softDeletes();
         $t->timestamps();
         $t->foreign('robot_id')->references('id')->on('i_robot')->onDelete('cascade');
         $t->foreign('agency_id')->references('id')->on('i_agency')->onDelete('cascade');
         $t->foreign('hospital_id')->references('id')->on('i_hospital')->onDelete('cascade');
     });
     $count = 5000;
     for ($i = 0; $i < $count; $i++) {
         db_c($this->ins_name, 'i', ['lease_type_id' => rand(1, 4), 'lease_started_at' => date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208)), 'lease_ended_at' => date("Y-m-d H:i:s", mt_rand(1440560208, 1640560208) + rand(190000, 390000)), 'hospital_id' => rand(1, 400), 'robot_id' => rand(1, 1000), 'agency_id' => rand(1, 1000), 'memo' => str_random(500)]);
     }
 }