修改app版本接口内容
parent
e53be8ff12
commit
0223a44027
|
|
@ -23,8 +23,8 @@ class AppVersionController extends AdminController
|
||||||
$grid->column('name');
|
$grid->column('name');
|
||||||
$grid->column('v');
|
$grid->column('v');
|
||||||
$grid->column('cate')->using([
|
$grid->column('cate')->using([
|
||||||
1=>'ios',
|
1=>'苹果',
|
||||||
2=>'android',
|
2=>'安卓',
|
||||||
]);
|
]);
|
||||||
$grid->column('is_force')->bool();
|
$grid->column('is_force')->bool();
|
||||||
$grid->column('link');
|
$grid->column('link');
|
||||||
|
|
@ -84,11 +84,13 @@ class AppVersionController extends AdminController
|
||||||
{
|
{
|
||||||
return Form::make(new AppVersion(), function (Form $form) {
|
return Form::make(new AppVersion(), function (Form $form) {
|
||||||
$form->display('id');
|
$form->display('id');
|
||||||
|
$form->text('title')->required();
|
||||||
|
$form->textarea('context')->required();
|
||||||
$form->text('name')->required();
|
$form->text('name')->required();
|
||||||
$form->number('v')->min(0);
|
$form->number('v')->min(0);
|
||||||
$form->radio('cate')->options([
|
$form->radio('cate')->options([
|
||||||
1=>'ios',
|
1=>'苹果',
|
||||||
2=>'android',
|
2=>'安卓',
|
||||||
]);
|
]);
|
||||||
$form->switch('is_force');
|
$form->switch('is_force');
|
||||||
$form->text('link')->required();
|
$form->text('link')->required();
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ class AppVersionResource extends JsonResource
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'title'=>$this->title,
|
||||||
|
'context'=>$this->context,
|
||||||
'name' => (string) $this->name,
|
'name' => (string) $this->name,
|
||||||
'v' => (int) $this->v,
|
'v' => (int) $this->v,
|
||||||
'is_force' => (bool) $this->is_force,
|
'is_force' => (bool) $this->is_force,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddTitleContextToAppVersionsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('app_versions', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->string('title')->comment('更新标题');
|
||||||
|
$table->text('context')->comment('更新内容');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('app_versions', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->dropColumn(['title', 'context']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'labels' => [
|
'labels' => [
|
||||||
'AppVersion' => 'AppVersion',
|
'AppVersion' => 'AppVersion',
|
||||||
'app-version' => 'AppVersion',
|
'app-version' => 'AppVersion',
|
||||||
],
|
],
|
||||||
'fields' => [
|
'fields' => [
|
||||||
|
'title' => '更新标题',
|
||||||
|
'context' => '更新内容',
|
||||||
'name' => '版本名称',
|
'name' => '版本名称',
|
||||||
'v' => '版本号',
|
'v' => '版本号',
|
||||||
'cate' => '类别',
|
'cate' => '平台',
|
||||||
'is_force' => '强制更新',
|
'is_force' => '强制更新',
|
||||||
'link' => '资源链接',
|
'link' => '资源链接',
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue