RententionBookList.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Modules\Book\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6. class RententionBookList extends Model
  7. {
  8. protected $table = 'rentention_book_list';
  9. protected $fillable = [
  10. 'bid',
  11. 'book_name',
  12. 'type',
  13. 'type_generate_time',
  14. 'is_deleted',
  15. 'sex',
  16. 'is_updated',
  17. 'updated_time',
  18. 'arpu',
  19. ];
  20. public static function createTable()
  21. {
  22. if (!Schema::hasTable('rentention_book_list')) {
  23. Schema::create('rentention_book_list', function (Blueprint $table) {
  24. $table->increments('id');
  25. $table->integer('bid');
  26. $table->string('book_name', 255);
  27. $table->integer('type');
  28. $table->dateTime('type_generate_time');
  29. $table->boolean('is_deleted');
  30. $table->timestamps();
  31. $table->index(['bid'], 'idx_bid');
  32. });
  33. }
  34. }
  35. }