Compare commits

...

3 Commits

Author SHA1 Message Date
vine_liutk 5234d880a7 添加友情链接返回is_iframe 2023-05-22 17:34:09 +08:00
vine_liutk 3cde3c221c 添加友情链接是否iframe 2023-05-22 17:33:35 +08:00
vine_liutk dd6ff0f99c 调整 2023-05-22 17:33:15 +08:00
3 changed files with 36 additions and 0 deletions

View File

@ -23,6 +23,7 @@ class FriendLinkResource extends JsonResource
'is_recommend' => $this->is_recommend,
'is_show' => $this->is_show,
'created_at' => strtotime($this->created_at) ?? 0, //录入时间
'is_iframe' => $this->is_iframe,
];
}
}

View File

@ -20,6 +20,7 @@ class FriendLink extends Model
protected $fillable = [
'name', 'type', 'content', 'sort', 'is_recommend', 'is_show',
'is_iframe',
];
public static function typeMap()

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('friend_links', function (Blueprint $table) {
//
$table->unsignedInteger('is_iframe')->default(0)->comment('是否iframe打开');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('friend_links', function (Blueprint $table) {
//
$table->dropColumn('is_iframe');
});
}
};