Showing
4 changed files
with
0 additions
and
191 deletions
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -namespace App\Admin\Controllers; | ||
| 4 | - | ||
| 5 | -use App\Admin\Repositories\AudioShow; | ||
| 6 | -use Dcat\Admin\Form; | ||
| 7 | -use Dcat\Admin\Grid; | ||
| 8 | -use Dcat\Admin\Show; | ||
| 9 | -use Dcat\Admin\Http\Controllers\AdminController; | ||
| 10 | - | ||
| 11 | -class AudioShowController extends AdminController | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * Make a grid builder. | ||
| 15 | - * | ||
| 16 | - * @return Grid | ||
| 17 | - */ | ||
| 18 | - protected function grid() | ||
| 19 | - { | ||
| 20 | - return Grid::make(new AudioShow(), function (Grid $grid) { | ||
| 21 | - $grid->column('id')->sortable(); | ||
| 22 | - $grid->column('image_url'); | ||
| 23 | - $grid->column('image_size'); | ||
| 24 | - $grid->column('audio_url'); | ||
| 25 | - $grid->column('audio_size'); | ||
| 26 | - $grid->column('audio_time'); | ||
| 27 | - $grid->column('created_at'); | ||
| 28 | - $grid->column('updated_at')->sortable(); | ||
| 29 | - | ||
| 30 | - $grid->filter(function (Grid\Filter $filter) { | ||
| 31 | - $filter->equal('id'); | ||
| 32 | - | ||
| 33 | - }); | ||
| 34 | - }); | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * Make a show builder. | ||
| 39 | - * | ||
| 40 | - * @param mixed $id | ||
| 41 | - * | ||
| 42 | - * @return Show | ||
| 43 | - */ | ||
| 44 | - protected function detail($id) | ||
| 45 | - { | ||
| 46 | - return Show::make($id, new AudioShow(), function (Show $show) { | ||
| 47 | - $show->field('id'); | ||
| 48 | - $show->field('image_url'); | ||
| 49 | - $show->field('image_size'); | ||
| 50 | - $show->field('audio_url'); | ||
| 51 | - $show->field('audio_size'); | ||
| 52 | - $show->field('audio_time'); | ||
| 53 | - $show->field('created_at'); | ||
| 54 | - $show->field('updated_at'); | ||
| 55 | - }); | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - /** | ||
| 59 | - * Make a form builder. | ||
| 60 | - * | ||
| 61 | - * @return Form | ||
| 62 | - */ | ||
| 63 | - protected function form() | ||
| 64 | - { | ||
| 65 | - return Form::make(new AudioShow(), function (Form $form) { | ||
| 66 | - $form->display('id'); | ||
| 67 | - $form->text('image_url'); | ||
| 68 | - $form->text('image_size'); | ||
| 69 | - $form->text('audio_url'); | ||
| 70 | - $form->text('audio_size'); | ||
| 71 | - $form->text('audio_time'); | ||
| 72 | - | ||
| 73 | - $form->display('created_at'); | ||
| 74 | - $form->display('updated_at'); | ||
| 75 | - }); | ||
| 76 | - } | ||
| 77 | -} |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -use Illuminate\Support\Facades\Schema; | ||
| 4 | -use Illuminate\Database\Schema\Blueprint; | ||
| 5 | -use Illuminate\Database\Migrations\Migration; | ||
| 6 | - | ||
| 7 | -class CreateUserShowTable extends Migration | ||
| 8 | -{ | ||
| 9 | - /** | ||
| 10 | - * Run the migrations. | ||
| 11 | - * | ||
| 12 | - * @return void | ||
| 13 | - */ | ||
| 14 | - public function up() | ||
| 15 | - { | ||
| 16 | - Schema::create('user_show', function (Blueprint $table) { | ||
| 17 | - $table->increments('id'); | ||
| 18 | - $table->unsignedBigInteger('user_id')->comment('用户id'); | ||
| 19 | - $table->text('content')->comment('内容描述'); | ||
| 20 | - $table->unsignedTinyInteger('type')->comment('1=图文,2=视频'); | ||
| 21 | - $table->unsignedBigInteger('pick_id')->index()->comment('引用的秀id'); | ||
| 22 | - $table->integer('fav_num')->comment('收藏数'); | ||
| 23 | - $table->integer('view_num')->comment('观看数'); | ||
| 24 | - $table->integer('praise_num')->comment('点赞数'); | ||
| 25 | - $table->integer('comment_num')->comment('评论数'); | ||
| 26 | - $table->unsignedBigInteger('child_id')->comment('图文/视频表id'); | ||
| 27 | - $table->unsignedTinyInteger('state')->comment('状态'); | ||
| 28 | - $table->timestamps(); | ||
| 29 | - }); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * Reverse the migrations. | ||
| 34 | - * | ||
| 35 | - * @return void | ||
| 36 | - */ | ||
| 37 | - public function down() | ||
| 38 | - { | ||
| 39 | - Schema::dropIfExists('user_show'); | ||
| 40 | - } | ||
| 41 | -} |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -use Illuminate\Support\Facades\Schema; | ||
| 4 | -use Illuminate\Database\Schema\Blueprint; | ||
| 5 | -use Illuminate\Database\Migrations\Migration; | ||
| 6 | - | ||
| 7 | -class CreateAudioShowTable extends Migration | ||
| 8 | -{ | ||
| 9 | - /** | ||
| 10 | - * Run the migrations. | ||
| 11 | - * | ||
| 12 | - * @return void | ||
| 13 | - */ | ||
| 14 | - public function up() | ||
| 15 | - { | ||
| 16 | - Schema::create('audio_show', function (Blueprint $table) { | ||
| 17 | - $table->increments('id'); | ||
| 18 | - $table->unsignedBigInteger('user_id')->index()->comment('用户id'); | ||
| 19 | - $table->string('image_url')->default('')->comment('图片地址'); | ||
| 20 | - $table->string('image_size')->default('')->comment('图片大小'); | ||
| 21 | - $table->string('audio_url')->default('')->comment('音频地址'); | ||
| 22 | - $table->string('audio_size')->default('')->comment('音频大小'); | ||
| 23 | - $table->string('audio_time')->default('')->comment('音频时长'); | ||
| 24 | - $table->timestamps(); | ||
| 25 | - }); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * Reverse the migrations. | ||
| 30 | - * | ||
| 31 | - * @return void | ||
| 32 | - */ | ||
| 33 | - public function down() | ||
| 34 | - { | ||
| 35 | - Schema::dropIfExists('audio_show'); | ||
| 36 | - } | ||
| 37 | -} |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -use Illuminate\Support\Facades\Schema; | ||
| 4 | -use Illuminate\Database\Schema\Blueprint; | ||
| 5 | -use Illuminate\Database\Migrations\Migration; | ||
| 6 | - | ||
| 7 | -class CreateVideoShowTable extends Migration | ||
| 8 | -{ | ||
| 9 | - /** | ||
| 10 | - * Run the migrations. | ||
| 11 | - * | ||
| 12 | - * @return void | ||
| 13 | - */ | ||
| 14 | - public function up() | ||
| 15 | - { | ||
| 16 | - Schema::create('video_show', function (Blueprint $table) { | ||
| 17 | - $table->increments('id'); | ||
| 18 | - $table->unsignedBigInteger('user_id')->index()->comment('用户id'); | ||
| 19 | - $table->string('video_url')->default('')->comment('视频地址'); | ||
| 20 | - $table->string('video_size')->default('')->comment('视频大小'); | ||
| 21 | - $table->string('video_time')->default('')->comment('视频时长'); | ||
| 22 | - $table->unsignedTinyInteger('is_horizontal')->comment('1=横版,2=竖版'); | ||
| 23 | - $table->timestamps(); | ||
| 24 | - }); | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - /** | ||
| 28 | - * Reverse the migrations. | ||
| 29 | - * | ||
| 30 | - * @return void | ||
| 31 | - */ | ||
| 32 | - public function down() | ||
| 33 | - { | ||
| 34 | - Schema::dropIfExists('video_show'); | ||
| 35 | - } | ||
| 36 | -} |
-
Please register or login to post a comment