generated from liutk/owl-admin-base
0.95
parent
df4fdc7901
commit
8095e134f6
|
|
@ -47,6 +47,7 @@ class AdController extends AdminController
|
|||
]))
|
||||
->columns([
|
||||
amis()->TableColumn('id', __('admin.ads.id'))->width('50px')->sortable(),
|
||||
amis()->TableColumn('title', __('admin.ads.title'))->width('300px'),
|
||||
amis()->TableColumn('address', __('admin.ads.address'))->type('mapping')
|
||||
->map(Keyword::allChildrenOfKey('banner_address')->pluck('name', 'key')->toArray())
|
||||
->itemSchema(amis()->Tag()->label('${item}')->color(Admin::setting()->get('system_theme_setting')['theme_color'] ?? '#1677ff')),
|
||||
|
|
@ -72,7 +73,9 @@ class AdController extends AdminController
|
|||
return $this->baseForm()->body([
|
||||
Components::make()->parentControl(admin_url('api/keywords/tree-list?parent_name=banner_address&has_owner=0'), 'address', __('admin.ads.address'), 'name', 'key')->required(true),
|
||||
Components::make()->imageControl('resource', __('admin.ads.resource'))->required(true),
|
||||
amis()->TextControl('remark', __('admin.ads.remark')),
|
||||
amis()->TextControl('title', __('admin.ads.title')),
|
||||
amis()->TextControl('sud_title', __('admin.ads.sud_title')),
|
||||
// amis()->TextControl('remark', __('admin.ads.remark')),
|
||||
Components::make()->sortControl('sort', __('admin.ads.sort')),
|
||||
amis()->DateTimeControl('published_at', __('admin.ads.published_at'))->format('YYYY-MM-DD HH:mm:ss')->description(__('admin.ads.published_at_remark')),
|
||||
amis()->SwitchControl('is_enable', __('admin.ads.is_enable'))->value(false),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ class AdResource extends JsonResource
|
|||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'title'=> $this->title,
|
||||
'sub_title'=> $this->sub_title,
|
||||
'resource_url' => $this->resource_url,
|
||||
'jump_type' => $this->jump_type,
|
||||
'jump_config' => $this->jump_config,
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ class Ad extends Model
|
|||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'sub_title',
|
||||
'resource',
|
||||
'address',
|
||||
'remark',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ads', function (Blueprint $table) {
|
||||
//
|
||||
$table->text('title')->nullable()->comment('标题');
|
||||
$table->text('sub_title')->nullable()->comment('副标题');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ads', function (Blueprint $table) {
|
||||
//
|
||||
$table->dropColumn(['title', 'sub_title']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -304,6 +304,8 @@ return [
|
|||
'id' => 'ID',
|
||||
'address' => '位置',
|
||||
'resource' =>'内容',
|
||||
'title'=>'标题',
|
||||
'sub_title'=>'副标题',
|
||||
'published_at' => '定时发布',
|
||||
'published_at_g' => '发布时间',
|
||||
'is_enable' => '显示',
|
||||
|
|
|
|||
Loading…
Reference in New Issue