init
This commit is contained in:
@@ -5,16 +5,16 @@ use think\migration\db\Column;
|
||||
|
||||
class AddGgPaiXuColumOnGuangGaoTable extends Migrator
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$Table = $this->table('guang_gao');
|
||||
// public function up()
|
||||
// {
|
||||
// $Table = $this->table('guang_gao');
|
||||
|
||||
$Table->addColumn('gg_sort', 'integer', ['after' => 'gg_tiao_zhuan_di_zhi'])->setComment("排序")->save();
|
||||
}
|
||||
// $Table->addColumn('gg_sort', 'integer', ['after' => 'gg_tiao_zhuan_di_zhi'])->setComment("排序")->save();
|
||||
// }
|
||||
|
||||
public function down()
|
||||
{
|
||||
$Table = $this->table('guang_gao');
|
||||
$Table->removeColumn('gg_sort')->save();
|
||||
}
|
||||
// public function down()
|
||||
// {
|
||||
// $Table = $this->table('guang_gao');
|
||||
// $Table->removeColumn('gg_sort')->save();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class SeoKeywordsTable extends Migrator
|
||||
{
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('seo_keywords', [
|
||||
'id' => 'sw_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 sw_title 字段,类型为字符串
|
||||
$table->addColumn('sw_title', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '关键词标题'
|
||||
]);
|
||||
|
||||
// 添加 sw_status 字段,类型为布尔值或整数
|
||||
$table->addColumn('sw_status', 'boolean', [
|
||||
'default' => 0,
|
||||
'null' => false,
|
||||
'comment' => '关键词状态,1表示启用,0表示禁用'
|
||||
]);
|
||||
|
||||
// 添加 sw_html_path 字段,类型为字符串
|
||||
$table->addColumn('sw_html_path', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => true,
|
||||
'comment' => '关键词关联的HTML路径'
|
||||
]);
|
||||
|
||||
// 为 sw_html_path 字段添加索引
|
||||
$table->addIndex(['sw_html_path'], [
|
||||
'unique' => false, // 如果你希望索引是唯一的,设置为 true
|
||||
'name' => 'idx_sw_html_path' // 索引名称,可以省略,系统会自动生成
|
||||
]);
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class GuanggaoAddStatus extends Migrator
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$Table = $this->table('guang_gao');
|
||||
|
||||
$Table->addColumn('gg_status', 'integer', ['after' => 'gg_tiao_zhuan_di_zhi', 'default' => 0])->setComment("状态")->save();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$Table = $this->table('guang_gao');
|
||||
$Table->removeColumn('gg_status')->save();
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoClass extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_class', [
|
||||
'id' => 'vc_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 vc_name 字段,类型为字符串
|
||||
$table->addColumn('vc_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '分类名称'
|
||||
]);
|
||||
// 添加 vc_name 字段,类型为字符串
|
||||
$table->addColumn('vc_nicheng', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '分类昵称'
|
||||
]);
|
||||
|
||||
$table->addColumn('vc_sort', 'integer', [
|
||||
'limit' => 255,
|
||||
'default'=>0,
|
||||
'comment' => '排序'
|
||||
]);
|
||||
// 添加 vc_status 字段,类型为布尔值或整数
|
||||
$table->addColumn('vc_status', 'boolean', [
|
||||
'default' => 1,
|
||||
'null' => false,
|
||||
'comment' => '关键词状态,1表示启用,0表示禁用'
|
||||
]);
|
||||
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoLeixin extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_leixin', [
|
||||
'id' => 'vl_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 vc_id 字段,
|
||||
$table->addColumn('vc_id', 'integer', [
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
'comment' => '分类id'
|
||||
]);
|
||||
|
||||
// 添加 vl_name 字段,类型为字符串
|
||||
$table->addColumn('vl_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '类型名称'
|
||||
]);
|
||||
// 添加 vp_sort 字段,
|
||||
$table->addColumn('vl_sort', 'integer', [
|
||||
'default'=>0,
|
||||
'comment' => '排序'
|
||||
]);
|
||||
|
||||
// 添加 vc_status 字段,类型为布尔值或整数
|
||||
$table->addColumn('vl_status', 'boolean', [
|
||||
'default' => 1,
|
||||
'null' => false,
|
||||
'comment' => '关键词状态,1表示启用,0表示禁用'
|
||||
]);
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoJuqing extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_juqing', [
|
||||
'id' => 'vj_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 vc_id 字段,
|
||||
$table->addColumn('vc_id', 'integer', [
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
'comment' => '分类id'
|
||||
]);
|
||||
|
||||
// 添加 vl_name 字段,类型为字符串
|
||||
$table->addColumn('vj_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '剧情名称'
|
||||
]);
|
||||
// 添加 vp_sort 字段,
|
||||
$table->addColumn('vj_sort', 'integer', [
|
||||
'default'=>0,
|
||||
'comment' => '排序'
|
||||
]);
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoDiqu extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_diqu', [
|
||||
'id' => 'vd_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 vc_id 字段,
|
||||
$table->addColumn('vc_id', 'integer', [
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
'comment' => '分类id'
|
||||
]);
|
||||
|
||||
// 添加 vl_name 字段,类型为字符串
|
||||
$table->addColumn('vd_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '地区名称'
|
||||
]);
|
||||
// 添加 vp_sort 字段,
|
||||
$table->addColumn('vd_sort', 'integer', [
|
||||
'limit' => 255,
|
||||
'default'=>0,
|
||||
'comment' => '排序'
|
||||
]);
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoYears extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_years', [
|
||||
'id' => 'vy_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 vc_id 字段,
|
||||
$table->addColumn('vc_id', 'integer', [
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
'comment' => '分类id'
|
||||
]);
|
||||
|
||||
// 添加 vl_name 字段,类型为字符串
|
||||
$table->addColumn('vy_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '年份名称'
|
||||
]);
|
||||
// 添加 vp_sort 字段,
|
||||
$table->addColumn('vy_sort', 'integer', [
|
||||
'limit' => 255,
|
||||
'default'=>0,
|
||||
'comment' => '排序'
|
||||
]);
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoLanguage extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_language', [
|
||||
'id' => 'vla_id' // 这里指定 sw_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 vc_id 字段,
|
||||
$table->addColumn('vc_id', 'integer', [
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
'comment' => '分类id'
|
||||
]);
|
||||
|
||||
// 添加 vl_name 字段,类型为字符串
|
||||
$table->addColumn('vla_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '语言名称'
|
||||
]);
|
||||
// 添加 vp_sort 字段,
|
||||
$table->addColumn('vla_sort', 'integer', [
|
||||
'limit' => 255,
|
||||
'default'=>0,
|
||||
'comment' => '排序'
|
||||
]);
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoInfo extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 video_info 表
|
||||
$table = $this->table('video_info', [
|
||||
'id' => 'v_id' // 这里指定 v_id 作为自增主键
|
||||
]);
|
||||
$table->addColumn('v_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']);
|
||||
$table->addColumn('v_cover', 'json', ['default' => null, 'null' => true, 'comment' => '封面']);
|
||||
|
||||
$table->addColumn('vc_id', 'integer', ['comment' => '视频分类id:1电影,2电视剧,3综艺,4动漫']);
|
||||
|
||||
$table->addColumn('v_pinyin', 'string', ['limit' => 255,'comment' => '[拼音id]']);
|
||||
$table->addColumn('v_leixin', 'string', ['limit' => 255,'null' => true,'comment' => '类型']);
|
||||
$table->addColumn('v_juqing', 'string', ['limit' => 255,'null' => true,'comment' => '剧情']);
|
||||
$table->addColumn('v_diqu', 'string', ['limit' => 255,'null' => true,'comment' => '地区']);
|
||||
$table->addColumn('v_years', 'string', ['limit' => 255,'null' => true,'comment' => '年份']);
|
||||
$table->addColumn('v_language', 'string', ['limit' => 255,'null' => true,'comment' => '语言']);
|
||||
|
||||
$table->addColumn('v_daoyan', 'string', ['limit' => 255,'null' => true,'comment' => '导演']);
|
||||
$table->addColumn('v_zhuyan', 'string', ['limit' => 255,'null' => true,'comment' => '主演']);
|
||||
$table->addColumn('v_orurl', 'string', ['limit' => 255,'comment' => '来源url']);
|
||||
$table->addColumn('v_md5', 'string', ['limit' => 255,'comment' => 'md5:vc_id+v_name+v_orurl']);
|
||||
$table->addColumn('v_jiaobiao', 'string', ['limit' => 255,'null' => true,'comment' => '角标']);
|
||||
|
||||
$table->addColumn('v_description', 'text', ['comment' => '简介']);
|
||||
|
||||
$table->addColumn('v_pingfen', 'decimal', ['precision' => 10, 'scale' => 2, 'default' => 0, 'comment' => '评分']);
|
||||
$table->addColumn('v_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常'));
|
||||
|
||||
$table->addColumn('v_click', 'integer', ['default'=>0,'comment' => '点击数']);
|
||||
$table->addColumn('v_recommend', 'integer', ['default'=>0,'comment' => '推荐等级']);
|
||||
|
||||
|
||||
$table->addColumn('update_time', 'datetime', ['null' => true, 'comment' => '更新时间']);
|
||||
$table->addColumn('create_time', 'datetime', ['null' => true, 'comment' => '创建时间']);
|
||||
|
||||
$table->addIndex('vc_id');
|
||||
$table->addIndex('v_md5');
|
||||
$table->addIndex('v_pinyin');
|
||||
$table->addIndex('v_status');
|
||||
// 添加复合索引 idx_vc_id_pingfen
|
||||
$table->addIndex(['vc_id', 'v_pingfen'], [
|
||||
'name' => 'idx_vc_id_pingfen',
|
||||
'unique' => false
|
||||
]);
|
||||
|
||||
// 添加复合索引 idx_vc_id_v_click
|
||||
$table->addIndex(['vc_id', 'v_click'], [
|
||||
'name' => 'idx_vc_id_v_click',
|
||||
'unique' => false
|
||||
]);
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
|
||||
|
||||
// $table->string('head_title',100)->default('')->comment('seo-标题');
|
||||
// $table->string('head_keyword',200)->default('')->comment('seo-关键词');
|
||||
// $table->string('head_description',255)->default('')->comment('seo-描述');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class VideoPlayurl extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_keywords 表
|
||||
$table = $this->table('video_playurl', [
|
||||
'id' => 'vp_id' // 这里指定 vp_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 v_id 字段,
|
||||
$table->addColumn('v_id', 'integer', [
|
||||
'comment' => '视频id'
|
||||
]);
|
||||
|
||||
// 添加 vp_sort 字段,
|
||||
$table->addColumn('vp_sort', 'integer', [
|
||||
'default'=>0,
|
||||
'comment' => '线路排序'
|
||||
]);
|
||||
|
||||
// 添加 vp_md5 字段,
|
||||
$table->addColumn('vp_md5', 'string', [
|
||||
'limit' => 255,
|
||||
'comment' => 'md5:v_id+vp_url'
|
||||
]);
|
||||
|
||||
|
||||
// 添加 vp_name 字段,类型为字符串
|
||||
$table->addColumn('vp_name', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => false,
|
||||
'comment' => '线路名称'
|
||||
]);
|
||||
|
||||
$table->addColumn('vp_url', 'json', [ 'null' => false, 'comment' => '播放地址']);
|
||||
$table->addIndex('v_id');
|
||||
$table->addIndex('vp_md5');
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class GanRaoMa extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 gan_rao_ma 表
|
||||
$table = $this->table('gan_rao_ma', [
|
||||
'id' => 'grm_id' // 这里指定 grm_id 作为自增主键
|
||||
]);
|
||||
|
||||
// 添加 grm_neirong 字段,类型为字符串
|
||||
$table->addColumn('grm_neirong', 'text', [
|
||||
'null' => false,
|
||||
'comment' => '干扰码内容'
|
||||
]);
|
||||
|
||||
// 添加 grm_status 字段,类型为布尔值或整数
|
||||
$table->addColumn('grm_status', 'boolean', [
|
||||
'default' => 0,
|
||||
'null' => false,
|
||||
'comment' => '干扰码状态,1表示启用,0表示禁用'
|
||||
]);
|
||||
|
||||
// 添加 grm_html_path 字段,类型为字符串
|
||||
$table->addColumn('grm_html_path', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => true,
|
||||
'comment' => '干扰码关联的HTML路径'
|
||||
]);
|
||||
|
||||
// 为 grm_html_path 字段添加索引
|
||||
$table->addIndex('grm_html_path');
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class SeoTdkConfig extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 seo_tdk_config 表
|
||||
$table = $this->table('seo_tdk_config', [
|
||||
'id' => 'stc_id' // 这里指定 stc_id 作为自增主键
|
||||
]);
|
||||
$table->addColumn('stc_code', 'string', ['limit' => 255,'null' => false,'comment' => '编码标识']);
|
||||
$table->addColumn('stc_name', 'string', ['limit' => 255,'null' => true,'comment' => '页面名称']);
|
||||
$table->addColumn('stc_title', 'string', ['limit' => 255,'null' => true,'comment' => '页面标题']);
|
||||
$table->addColumn('stc_keywords', 'string', ['limit' => 255,'null' => true,'comment' => '页面关键词']);
|
||||
$table->addColumn('stc_description', 'string', ['limit' => 255,'null' => true,'comment' => '页面描述']);
|
||||
$table->addColumn('stc_other_conf', 'string', ['limit' => 255,'null' => true,'comment' => '其它配置']);
|
||||
$table->addColumn('stc_tongji_daima', 'string', ['limit' => 255,'null' => true,'comment' => '页面统计代码']);
|
||||
$table->addColumn('stc_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常'));
|
||||
$table->addIndex('stc_code');
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class CreateVisitLogs extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 visit_logs 表
|
||||
$visitLogsTable = $this->table('visit_logs', [
|
||||
'id' => 'vil_id' // 这里指定 stc_id 作为自增主键
|
||||
]);
|
||||
|
||||
$visitLogsTable->addColumn('vil_ip', 'string', ['limit' => 45, 'null' => false, 'comment' => '访问者 IP 地址'])
|
||||
->addColumn('vil_url', 'text', ['null' => false, 'comment' => '访问的 URL'])
|
||||
->addColumn('vil_method', 'string', ['limit' => 10, 'null' => false, 'comment' => 'HTTP 方法'])
|
||||
->addColumn('vil_content_type', 'enum', ['values' => ['video', 'novel', 'page'], 'null' => false, 'comment' => '内容类型(视频、小说、页面)'])
|
||||
->addColumn('vil_content_id', 'string', ['default' => '','null' => false, 'comment' => '内容 ID(视频、小说或页面的唯一标识)'])
|
||||
|
||||
->addColumn('vil_user_agent', 'text', ['null' => true, 'comment' => 'User-Agent 信息'])
|
||||
->addColumn('vil_headers', 'text', ['null' => true, 'comment' => '请求头信息'])
|
||||
->addColumn('vil_is_spider', 'boolean', ['default' => 0, 'comment' => '是否为爬虫:0-否,1-是'])
|
||||
->addColumn('vil_location', 'text', ['null' => true, 'comment' => '地理位置'])
|
||||
->addColumn('vil_user_id', 'biginteger', ['null' => true, 'comment' => '用户 ID(可选)'])
|
||||
->addColumn('vil_timestamp', 'datetime', ['null' => true,'default' => 'CURRENT_TIMESTAMP', 'comment' => '访问时间'])
|
||||
// 添加索引
|
||||
->addIndex(['vil_content_type', 'vil_content_id'], ['name' => 'idx_content_type_id'])
|
||||
->addIndex('vil_timestamp', ['name' => 'idx_timestamp'])
|
||||
->addIndex('vil_is_spider', ['name' => 'idx_is_spider'])
|
||||
->addIndex('vil_user_id', ['name' => 'idx_user_id'])
|
||||
->addIndex('vil_ip', ['name' => 'idx_ip'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class CreateContentStats extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
|
||||
// 创建 content_stats 表
|
||||
$table = $this->table('content_stats', [
|
||||
'id' => 'cs_id' // 这里指定 stc_id 作为自增主键
|
||||
]);
|
||||
|
||||
|
||||
$table->addColumn('cs_content_type', 'enum', [
|
||||
'values' => ['video', 'novel', 'page'], // 扩展支持页面
|
||||
'null' => false,
|
||||
'comment' => '内容类型(视频、小说、页面)'
|
||||
])
|
||||
->addColumn('cs_content_id', 'string', [
|
||||
'null' => false,
|
||||
'comment' => '内容 ID(视频、小说或页面 ID)'
|
||||
])
|
||||
->addColumn('cs_stat_date', 'string', [
|
||||
'null' => false,
|
||||
'comment' => '统计日期'
|
||||
])
|
||||
->addColumn('cs_stat_period', 'enum', [
|
||||
'values' => ['day', 'week', 'month', 'quarter', 'year'],
|
||||
'null' => false,
|
||||
'comment' => '统计周期'
|
||||
])
|
||||
->addColumn('cs_pv', 'integer', [
|
||||
'null' => false,
|
||||
'default' => 0,
|
||||
'comment' => '页面浏览量(PV)'
|
||||
])
|
||||
->addColumn('cs_uv', 'integer', [
|
||||
'null' => false,
|
||||
'default' => 0,
|
||||
'comment' => '独立访客量(UV)'
|
||||
])
|
||||
->addColumn('updated_at', 'timestamp', [
|
||||
'default' => 'CURRENT_TIMESTAMP',
|
||||
'update' => 'CURRENT_TIMESTAMP',
|
||||
'comment' => '更新时间'
|
||||
])
|
||||
->addColumn('cs_md5', 'string', [
|
||||
'default' => '',
|
||||
'null' => false,
|
||||
'comment' => 'md5(cs_content_type+cs_content_id+cs_stat_date+cs_stat_period'
|
||||
])
|
||||
// 添加索引
|
||||
->addIndex('cs_content_type', ['name' => 'cs_content_type'])
|
||||
->addIndex('cs_content_id', ['name' => 'cs_content_id'])
|
||||
->addIndex('cs_stat_date', ['name' => 'cs_stat_date'])
|
||||
->addIndex('cs_stat_period', ['name' => 'cs_stat_period'])
|
||||
->addIndex(['cs_md5'], [
|
||||
'unique' => true,
|
||||
'name' => 'unique_cs_md5'
|
||||
])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AddNewColumnToVideoInfo extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('video_info');
|
||||
|
||||
// 添加 "影院售票总额" 字段
|
||||
$table->addColumn('v_ticket_sales', 'decimal', [
|
||||
'precision' => 12, // 最大 9999999999.99
|
||||
'scale' => 2, // 保留两位小数
|
||||
'default' => 0.00, // 默认值 0.00
|
||||
'comment' => '影院售票总额(单位:亿元)'
|
||||
])->update();
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class SeoHtml extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 video_info 表
|
||||
$table = $this->table('seo_html', [
|
||||
'id' => 'sh_id' // 这里指定 v_id 作为自增主键
|
||||
]);
|
||||
$table->addColumn('sh_title', 'string', ['limit' => 255,'null' => false,'comment' => 'title']);
|
||||
$table->addColumn('sh_keywords', 'string', ['limit' => 255,'null' => false,'comment' => 'keywords']);
|
||||
$table->addColumn('sh_description', 'text', ['comment' => '简介']);
|
||||
$table->addColumn('sh_body', 'text', ['comment' => '内容']);
|
||||
$table->addColumn('sh_click', 'integer', ['default'=>0,'comment' => '点击数']);
|
||||
$table->addColumn('sh_html_path', 'string', ['limit' => 255, 'null' => true,'comment' => 'HTML源文件路径']);
|
||||
$table->addColumn('update_time', 'datetime', ['null' => true, 'comment' => '更新时间']);
|
||||
$table->addColumn('create_time', 'datetime', ['null' => true, 'comment' => '创建时间']);
|
||||
$table->addIndex('sh_html_path');
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class CreateXiaoShuoXiangQingSeo extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 video_info 表
|
||||
$table = $this->table('novel_info_seo', [
|
||||
'id' => 'nis_id' // 这里指定 v_id 作为自增主键
|
||||
]);
|
||||
$table->addColumn('nis_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']);
|
||||
|
||||
$table->addColumn('nis_jie_shao', 'text', ['comment' => '介绍']);
|
||||
|
||||
$table->addColumn('xsxq_id', 'integer', ['comment' => '小说详情id']);
|
||||
|
||||
$table->addColumn('nis_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常'));
|
||||
|
||||
$table->addColumn('nis_click', 'integer', ['default'=>0,'comment' => '点击数']);
|
||||
|
||||
$table->addColumn('nis_md5', 'string', ['limit' => 255,'comment' => 'md5:xsxq_id+nis_name']);
|
||||
|
||||
$table->addIndex('xsxq_id');
|
||||
$table->addIndex('nis_md5');
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AddNewColumnToXiaoShuoZhangJie extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('xiao_shuo_zhang_jie');
|
||||
|
||||
// 添加 "章节索引" 字段
|
||||
$table->addColumn('xszj_sort', 'integer', [
|
||||
'default' => 1,
|
||||
'comment' => '章节索引'
|
||||
]);
|
||||
|
||||
// 修改字段 "xszj_ming_zi",使其不能为空
|
||||
$table->changeColumn('xszj_ming_zi', 'string', [
|
||||
'null' => false, // 设置字段为 NOT NULL
|
||||
'comment' => '章节名称'
|
||||
]);
|
||||
|
||||
// 添加 "xszj_source_code" 字段并设置为唯一
|
||||
// $table->addColumn('xszj_source_code', 'string', [
|
||||
// 'null' => false,
|
||||
// 'comment' => '来源代码'
|
||||
// ]);
|
||||
|
||||
// 为 "xszj_source_code" 添加唯一索引,确保其值唯一
|
||||
//$table->addIndex(['xszj_source_code'], ['unique' => true]);
|
||||
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class CreateVideoInfoSeo extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 video_info 表
|
||||
$table = $this->table('video_info_seo', [
|
||||
'id' => 'vis_id' // 这里指定 v_id 作为自增主键
|
||||
]);
|
||||
$table->addColumn('vis_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']);
|
||||
|
||||
$table->addColumn('vis_jie_shao', 'text', ['comment' => '介绍']);
|
||||
|
||||
$table->addColumn('v_id', 'integer', ['comment' => '详情id']);
|
||||
|
||||
$table->addColumn('vis_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常'));
|
||||
|
||||
$table->addColumn('vis_click', 'integer', ['default'=>0,'comment' => '点击数']);
|
||||
|
||||
$table->addColumn('vis_md5', 'string', ['limit' => 255,'comment' => 'md5:v_id+vis_name']);
|
||||
|
||||
$table->addIndex('v_id');
|
||||
$table->addIndex('vis_md5');
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class CreateSite extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 创建 video_info 表
|
||||
$table = $this->table('site', [
|
||||
'id' => 'site_id' // 这里指定 v_id 作为自增主键
|
||||
]);
|
||||
$table->addColumn('site_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']);
|
||||
$table->addColumn('site_type', 'string', ['limit' => 255,'null' => false,'comment' => '站点类型:novel.video']);
|
||||
$table->addColumn('site_log_type', 'string', ['limit' => 255,'null' => false,'comment' => 'logo类型 1:图片,2:文字']);
|
||||
$table->addColumn('site_email', 'string', ['limit' => 255,'null' => false,'comment' => '邮箱']);
|
||||
$table->addColumn('site_telegram', 'string', ['limit' => 255,'null' => false,'comment' => 'Telegram']);
|
||||
$table->addColumn('site_domain', 'string', ['limit' => 255,'null' => false,'comment' => '域名']);
|
||||
$table->addColumn('site_share_domain', 'string', ['limit' => 255,'null' => false,'comment' => '分享域名']);
|
||||
$table->addColumn('site_version', 'string', ['limit' => 255,'null' => false,'comment' => '版本号']);
|
||||
$table->addColumn('site_fenlei_path', 'string', ['limit' => 255,'null' => true,'comment' => '分类路由目录']);
|
||||
$table->addColumn('site_xiangqing_path', 'string', ['limit' => 255,'null' => true,'comment' => '详情路由目录']);
|
||||
$table->addColumn('site_zhangjie_path', 'string', ['limit' => 255,'null' => true,'comment' => '章节路由目录']);
|
||||
$table->addColumn('site_rank_path', 'string', ['limit' => 255,'null' => true,'comment' => '排行榜路由目录']);
|
||||
$table->addColumn('site_tui_jian_path', 'string', ['limit' => 255,'null' => true,'comment' => '推荐路由目录']);
|
||||
$table->addColumn('site_seo_path', 'string', ['limit' => 255,'null' => true,'comment' => '详情seo词路由目录']);
|
||||
$table->addColumn('site_zdy_path', 'string', ['limit' => 255,'null' => true,'comment' => '自定义seo页面路由目录']);
|
||||
$table->addColumn('site_tongji', 'text', ['comment' => '统计']);
|
||||
$table->addColumn('site_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常'));
|
||||
|
||||
// 创建表
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AddCloumaToAllTableAddSite extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
// 需要添加 `site_id` 的表 gan_rao_ma guang_gao guang_gao_pei_zhi guang_gao_fen_zu plan_task seo_tdk_config system_config video_class visit_logs content_stats xiao_shuo_fen_lei
|
||||
$tables = ['gan_rao_ma', 'guang_gao', 'guang_gao_pei_zhi', 'guang_gao_fen_zu', 'plan_task', 'seo_tdk_config', 'system_config', 'video_class', 'visit_logs', 'content_stats', 'xiao_shuo_fen_lei']; // 这里填写你的表名
|
||||
|
||||
foreach ($tables as $table) {
|
||||
if ($this->hasTable($table)) {
|
||||
$tableObject = $this->table($table);
|
||||
|
||||
// 检查是否已经有 site_id 字段
|
||||
if (!$tableObject->hasColumn('site_id')) {
|
||||
$tableObject->addColumn('site_id', 'integer', [
|
||||
'default' => 1,
|
||||
'comment' => '站点ID'
|
||||
]);
|
||||
}
|
||||
|
||||
// 添加索引(避免重复添加索引)
|
||||
if (!$tableObject->hasIndex(['site_id'])) {
|
||||
$tableObject->addIndex(['site_id']);
|
||||
}
|
||||
|
||||
$tableObject->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AddCloumnToXiaoShuoFenLei extends Migrator
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$Table = $this->table('xiao_shuo_fen_lei');
|
||||
if (!$Table->hasColumn('xsfl_sort')) {
|
||||
$Table->addColumn('xsfl_sort', 'integer', ['after' => 'site_id'])->setComment("排序")->save();
|
||||
}
|
||||
|
||||
$Table = $this->table('video_class');
|
||||
if (!$Table->hasColumn('vc_source_id')) {
|
||||
$Table->addColumn('vc_source_id', 'integer', ['after' => 'site_id'])->setComment("资源绑定真实id")->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$Table = $this->table('xiao_shuo_fen_lei');
|
||||
if ($Table->hasColumn('xsfl_sort')) {
|
||||
$Table->removeColumn('xsfl_sort')->save();
|
||||
}
|
||||
|
||||
$Table = $this->table('video_class');
|
||||
if ($Table->hasColumn('vc_source_id')) {
|
||||
$Table->removeColumn('vc_source_id')->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,112 +9,23 @@ class PlanTaskSeeder
|
||||
{
|
||||
static public function handle()
|
||||
{
|
||||
// 公共任务
|
||||
$arrData = [
|
||||
|
||||
[
|
||||
'pt_name' => '统计汇总',
|
||||
'pt_code' => 'PULL_TONJI_HUIZON',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($arrData as $arrPlanTask) {
|
||||
$PlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find();
|
||||
|
||||
if (empty($PlanTaskModel)) {
|
||||
PlanTaskModel::insert($arrPlanTask);
|
||||
}
|
||||
}
|
||||
|
||||
if (config('app.default_app_type') == 'video') {
|
||||
self::addVideoTypePlanTask();
|
||||
}
|
||||
if (config('app.default_app_type') == 'novel') {
|
||||
self::addNovelTypePlanTask();
|
||||
}
|
||||
self::addNovelTypePlanTask();
|
||||
}
|
||||
|
||||
// 添加视频类型站点 爬虫任务
|
||||
static public function addVideoTypePlanTask()
|
||||
{
|
||||
$arrData = [
|
||||
[
|
||||
'pt_name' => '采集大地电影',
|
||||
'pt_code' => 'PULL_DADI_DIANYHHING',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集黑木耳资源',
|
||||
'pt_code' => 'PULL_HEI_MUER',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 12 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集优质资源',
|
||||
'pt_code' => 'PULL_YOUZHI',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 12 * 3600,
|
||||
]
|
||||
];
|
||||
foreach ($arrData as $arrPlanTask) {
|
||||
$NovelOnePlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find();
|
||||
|
||||
if (empty($NovelOnePlanTaskModel)) {
|
||||
PlanTaskModel::insert($arrPlanTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 添加小说类型站点 爬虫任务
|
||||
static public function addNovelTypePlanTask()
|
||||
{
|
||||
$arrDataNovel = [
|
||||
[
|
||||
'pt_name' => '123采集小说',
|
||||
'pt_code' => 'PULL_XIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集天籁小说',
|
||||
'pt_code' => 'PULL_TIANLAIXIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集biquxs小说',
|
||||
'pt_code' => 'PULL_BIQUXSXIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集5ccc小说',
|
||||
'pt_code' => 'PULL_5CCCXIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集630zw.org小说',
|
||||
'pt_code' => 'PULL_630ZWXIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600,
|
||||
],
|
||||
[
|
||||
'pt_name' => '采集鬼吹灯小说', // 采集鬼吹灯-九域凡仙小说
|
||||
'pt_code' => 'PULL_GUICHUIDENG_XIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600 * 3,
|
||||
],
|
||||
|
||||
[
|
||||
'pt_name' => '采集文学馆小说', // 采集文学馆-都市极品医神
|
||||
'pt_code' => 'PULL_WENXUEGUAN_XIAOSHUO',
|
||||
'pt_enable' => 0,
|
||||
'pt_limit' => 24 * 3600 * 3,
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
foreach ($arrDataNovel as $arrPlanTask) {
|
||||
$NovelOnePlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find();
|
||||
|
||||
@@ -1,318 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace database\seeders;
|
||||
|
||||
use app\admin\model\VideoInfoModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
|
||||
class VideoInfoSeeder
|
||||
{
|
||||
static public function handle()
|
||||
{
|
||||
/*
|
||||
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 206.69 WHERE `v_name` = '阿凡达';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 203.15 WHERE `v_name` = '复仇者联盟4:终局之战';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 168.25 WHERE `v_name` = '阿凡达:水之道';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 161.58 WHERE `v_name` = '泰坦尼克号';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 143.69 WHERE `v_name` = '星球大战7:原力觉醒';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 136.78 WHERE `v_name` = '复仇者联盟3:无限战争';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 130.20 WHERE `v_name` = '蜘蛛侠:英雄无归';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 129.95 WHERE `v_name` = '侏罗纪世界';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 118.23 WHERE `v_name` = '狮子王(2019)';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 117.94 WHERE `v_name` = '复仇者联盟';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 116.24 WHERE `v_name` = '速度与激情7';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 114.54 WHERE `v_name` = '冰雪奇缘2';
|
||||
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 112.57 WHERE `v_name` = '复仇者联盟2:奥创纪元';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 110.45 WHERE `v_name` = '黑豹';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 108.34 WHERE `v_name` = '哈利·波特与死亡圣器(下)';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 106.82 WHERE `v_name` = '超人总动员2';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 104.85 WHERE `v_name` = '速度与激情8';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 103.76 WHERE `v_name` = '美女与野兽(2017)';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 101.75 WHERE `v_name` = '小黄人大眼萌';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 95.75 WHERE `v_name` = '哪吒之魔童闹海';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 98.99 WHERE `v_name` = '钢铁侠3';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 96.45 WHERE `v_name` = '海王';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 95.78 WHERE `v_name` = '美国队长3:内战';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 94.63 WHERE `v_name` = '变形金刚4:绝迹重生';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 93.58 WHERE `v_name` = '哈利·波特与魔法石';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 92.47 WHERE `v_name` = '蜘蛛侠:英雄归来';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 91.23 WHERE `v_name` = '蝙蝠侠:黑暗骑士';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 90.15 WHERE `v_name` = '超凡蜘蛛侠';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 89.78 WHERE `v_name` = '星球大战8:最后的绝地武士';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 87.45 WHERE `v_name` = '星球大战9:天行者崛起';
|
||||
UPDATE `video_info` SET `v_ticket_sales` = 86.12 WHERE `v_name` = '小丑';
|
||||
|
||||
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 10.00 WHERE `v_name` = '哪吒之魔童闹海';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 9.80 WHERE `v_name` = '遮天';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 9.50 WHERE `v_name` = '熊出没·重启未来';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 9.20 WHERE `v_name` = '唐人街探案2';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 9.00 WHERE `v_name` = '美国队长4';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 9.00 WHERE `v_name` = '超凡蜘蛛侠';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.90 WHERE `v_name` = '复仇者联盟2:奥创纪元';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.80 WHERE `v_name` = '哈利·波特与死亡圣器(下)';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.70 WHERE `v_name` = '速度与激情8';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.60 WHERE `v_name` = '狮子王(2019)';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.60 WHERE `v_name` = '星球大战8:最后的绝地武士';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.50 WHERE `v_name` = '海王';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.40 WHERE `v_name` = '变形金刚4:绝迹重生';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.30 WHERE `v_name` = '星球大战9:天行者崛起';
|
||||
UPDATE `video_info` SET `v_recommend` = 9 , `v_pingfen` = 7.20 WHERE `v_name` = '小丑';
|
||||
|
||||
|
||||
*/
|
||||
$arrData = [
|
||||
['v_name' => '阿凡达', 'v_ticket_sales' => 206.69],
|
||||
['v_name' => '复仇者联盟4:终局之战', 'v_ticket_sales' => 203.15],
|
||||
['v_name' => '阿凡达:水之道', 'v_ticket_sales' => 168.25],
|
||||
['v_name' => '泰坦尼克号', 'v_ticket_sales' => 161.58],
|
||||
['v_name' => '哪吒之魔童闹海', 'v_ticket_sales' => 145],
|
||||
['v_name' => '星球大战7:原力觉醒', 'v_ticket_sales' => 143.69],
|
||||
['v_name' => '复仇者联盟3:无限战争', 'v_ticket_sales' => 136.78],
|
||||
['v_name' => '蜘蛛侠:英雄无归', 'v_ticket_sales' => 130.20],
|
||||
['v_name' => '侏罗纪世界', 'v_ticket_sales' => 129.95],
|
||||
['v_name' => '狮子王(2019)', 'v_ticket_sales' => 118.23],
|
||||
['v_name' => '复仇者联盟', 'v_ticket_sales' => 117.94],
|
||||
['v_name' => '速度与激情7', 'v_ticket_sales' => 116.24],
|
||||
['v_name' => '冰雪奇缘2', 'v_ticket_sales' => 114.54],
|
||||
['v_name' => '复仇者联盟2:奥创纪元', 'v_ticket_sales' => 112.57],
|
||||
['v_name' => '黑豹', 'v_ticket_sales' => 110.45],
|
||||
|
||||
['v_name' => '哈利·波特与死亡圣器(下)', 'v_ticket_sales' => 108.34],
|
||||
['v_name' => '超人总动员2', 'v_ticket_sales' => 106.82],
|
||||
['v_name' => '速度与激情8', 'v_ticket_sales' => 104.85],
|
||||
['v_name' => '美女与野兽(2017)', 'v_ticket_sales' => 103.76],
|
||||
['v_name' => '小黄人大眼萌', 'v_ticket_sales' => 101.75],
|
||||
['v_name' => '钢铁侠3', 'v_ticket_sales' => 98.99],
|
||||
['v_name' => '海王', 'v_ticket_sales' => 96.45],
|
||||
['v_name' => '美国队长3:内战', 'v_ticket_sales' => 95.78],
|
||||
['v_name' => '变形金刚4:绝迹重生', 'v_ticket_sales' => 94.63],
|
||||
['v_name' => '哈利·波特与魔法石', 'v_ticket_sales' => 93.58],
|
||||
['v_name' => '蜘蛛侠:英雄归来', 'v_ticket_sales' => 92.47],
|
||||
['v_name' => '蝙蝠侠:黑暗骑士', 'v_ticket_sales' => 91.23],
|
||||
['v_name' => '超凡蜘蛛侠', 'v_ticket_sales' => 90.15],
|
||||
['v_name' => '星球大战8:最后的绝地武士', 'v_ticket_sales' => 89.78],
|
||||
['v_name' => '冰雪奇缘', 'v_ticket_sales' => 88.69],
|
||||
['v_name' => '星球大战9:天行者崛起', 'v_ticket_sales' => 87.45],
|
||||
['v_name' => '小丑', 'v_ticket_sales' => 86.12],
|
||||
];
|
||||
|
||||
foreach ($arrData as $arrDataOne) {
|
||||
$VideoInfoModel = VideoInfoModel::where('v_name', $arrDataOne['v_name'])->find();
|
||||
if (!empty($VideoInfoModel)) {
|
||||
try {
|
||||
$VideoInfoModel->v_ticket_sales = $arrDataOne['v_ticket_sales'];
|
||||
$VideoInfoModel->save();
|
||||
} catch (\Exception $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
self::updateVideo();
|
||||
self::updateNovel();
|
||||
|
||||
|
||||
}
|
||||
|
||||
static public function updateVideo()
|
||||
{
|
||||
/*
|
||||
|
||||
推荐
|
||||
*/
|
||||
$arrData = [
|
||||
['v_name' => '遮天'],
|
||||
['v_name' => '滤镜'],
|
||||
['v_name' => '战狼'],
|
||||
['v_name' => '战狼2'],
|
||||
['v_name' => '天道'],
|
||||
['v_name' => '黑冰'],
|
||||
['v_name' => '长城'],
|
||||
['v_name' => '异型'],
|
||||
['v_name' => '滴滴代驾'],
|
||||
['v_name' => '我靠鉴宝走向人生巅峰'],
|
||||
['v_name' => '我叫苏妲己'],
|
||||
['v_name' => '九州战神'],
|
||||
['v_name' => '仙逆'],
|
||||
['v_name' => '似锦'],
|
||||
['v_name' => '斗破苍穹'],
|
||||
['v_name' => '庆余年'],
|
||||
['v_name' => '庆余年第二季'],
|
||||
['v_name' => '繁花'],
|
||||
['v_name' => '玫瑰的故事'],
|
||||
['v_name' => '大奉打更人'],
|
||||
['v_name' => '县委大院'],
|
||||
['v_name' => '三国演义'],
|
||||
['v_name' => '三体'],
|
||||
['v_name' => '鬼吹灯'],
|
||||
['v_name' => '云顶天宫'],
|
||||
['v_name' => '盗墓笔记'],
|
||||
['v_name' => '家有儿女'],
|
||||
['v_name' => '湄公河大案'],
|
||||
['v_name' => '亮剑'],
|
||||
['v_name' => '爱情公寓'],
|
||||
['v_name' => '爱情公寓2'],
|
||||
['v_name' => '爱情公寓3'],
|
||||
['v_name' => '我叫王土地'],
|
||||
['v_name' => '唐人街探索案'],
|
||||
['v_name' => '唐人街探索案2'],
|
||||
['v_name' => '唐人街探索案3'],
|
||||
['v_name' => '749局'],
|
||||
['v_name' => '红海行动'],
|
||||
['v_name' => '僵尸叔叔'],
|
||||
['v_name' => '哈利·波特与死亡圣器(下'],
|
||||
['v_name' => '超人总动员2'],
|
||||
['v_name' => '速度与激情8'],
|
||||
['v_name' => '美女与野兽(2017)'],
|
||||
['v_name' => '小黄人大眼萌'],
|
||||
['v_name' => '钢铁侠3'],
|
||||
['v_name' => '毒液'],
|
||||
['v_name' => '海王'],
|
||||
['v_name' => '美国队长3:内战'],
|
||||
['v_name' => '变形金刚4:绝迹重生'],
|
||||
['v_name' => '哈利·波特与魔法石'],
|
||||
['v_name' => '蜘蛛侠:英雄归来'],
|
||||
['v_name' => '蝙蝠侠:黑暗骑士'],
|
||||
['v_name' => '超凡蜘蛛侠'],
|
||||
['v_name' => '星球大战8:最后的绝地武士'],
|
||||
['v_name' => '冰雪奇缘'],
|
||||
['v_name' => '星球大战9:天行者崛起'],
|
||||
['v_name' => '小丑'],
|
||||
['v_name' => '阿凡达'],
|
||||
['v_name' => '复仇者联盟4:终局之战'],
|
||||
['v_name' => '阿凡达:水之道'],
|
||||
['v_name' => '泰坦尼克号'],
|
||||
['v_name' => '哪吒之魔童闹海'],
|
||||
['v_name' => '星球大战7:原力觉醒'],
|
||||
['v_name' => '复仇者联盟3:无限战争'],
|
||||
['v_name' => '蜘蛛侠:英雄无归'],
|
||||
['v_name' => '侏罗纪世界'],
|
||||
['v_name' => '狮子王(2019)'],
|
||||
['v_name' => '复仇者联盟'],
|
||||
['v_name' => '速度与激情7'],
|
||||
['v_name' => '冰雪奇缘2'],
|
||||
['v_name' => '复仇者联盟2:奥创纪元'],
|
||||
['v_name' => '黑豹'],
|
||||
['v_name' => '六姊妹'],
|
||||
['v_name' => '侏罗纪世界3'],
|
||||
['v_name' => '唐伯虎点点秋香'],
|
||||
['v_name' => '欢乐颂'],
|
||||
['v_name' => '人再囧途之泰囧'],
|
||||
['v_name' => '囧途'],
|
||||
['v_name' => '速度与激情10'],
|
||||
['v_name' => '绝地战警:生死与共'],
|
||||
['v_name' => '毒液:最后一舞'],
|
||||
['v_name' => '食神'],
|
||||
['v_name' => '终极代码'],
|
||||
['v_name' => '终极代码'],
|
||||
['v_name' => '前任4:英年早婚'],
|
||||
['v_name' => '前任3:再见前任'],
|
||||
['v_name' => '前任2:备胎反击战'],
|
||||
['v_name' => '前任攻略'],
|
||||
['v_name' => '下一任:前任'],
|
||||
['v_name' => '诡迷心笑'],
|
||||
['v_name' => '城中之城'],
|
||||
['v_name' => '精英律师'],
|
||||
['v_name' => '走走停停'],
|
||||
['v_name' => '猎场'],
|
||||
['v_name' => '深海狂鲨2'],
|
||||
];
|
||||
|
||||
foreach ($arrData as $arrDataOne) {
|
||||
$VideoInfoModel = VideoInfoModel::where('v_name', $arrDataOne['v_name'])->find();
|
||||
if (!empty($VideoInfoModel)) {
|
||||
try {
|
||||
$VideoInfoModel->v_recommend = 9;
|
||||
$VideoInfoModel->save();
|
||||
} catch (\Exception $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static public function updateNovel(){
|
||||
$arrData = [
|
||||
['xsxq_ming_zi' => '遮天', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '完美世界', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '圣墟', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '斗破苍穹', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '武动乾坤', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '大主宰', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '雪中悍刀行', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '择天记', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '凡人修仙传', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '仙逆', 'xsxq_tui_jian' => 1],
|
||||
|
||||
['xsxq_ming_zi' => '人间有剑', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '步步高升:从省考状元到权力巅峰', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '源力过载', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '天下长宁', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '剑来', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '捞尸人', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '轮回乐园', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '没钱修什么仙?', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '夜无疆', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '谁让他盛世美颜', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '牧神记', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '吞噬星空', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '全家偷听我心声杀疯了,我负责吃奶', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '盖世神医', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '太荒吞天诀', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '不朽剑神', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '乾坤剑神', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '帝武丹尊', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '都市武圣', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '我们的火红年代', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '利欲升迁记', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '做局', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '巅峰权力', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '狂少下山', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '对手', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '人间政道', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '官道之绝对权力', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '我的透视超给力', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '穿书七零:作精女配她暴富了', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '长生仙游', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '分手后我成了前任他小婶', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '农门长姐:我娇养了五个哥哥', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '龙血战神', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '修罗武神', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '穿到三千小世界里当炮灰', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '女总裁的全能兵王', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '九星霸体诀', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '天官赐福', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '全球高考', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '撒野', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '修罗武神', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '人皇纪', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '万古仙穹', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '元尊', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '妙医鸿途', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '最强逆袭', 'xsxq_tui_jian' => 1],
|
||||
['xsxq_ming_zi' => '重生之国民男神', 'xsxq_tui_jian' => 1],
|
||||
|
||||
|
||||
];
|
||||
|
||||
foreach ($arrData as $arrDataOne) {
|
||||
$XiaoShuoXiangQingModel = XiaoShuoXiangQingModel::where('xsxq_ming_zi', $arrDataOne['xsxq_ming_zi'])->find();
|
||||
if (!empty($XiaoShuoXiangQingModel)) {
|
||||
try {
|
||||
$XiaoShuoXiangQingModel->xsxq_tui_jian = $arrDataOne['xsxq_tui_jian'];
|
||||
$XiaoShuoXiangQingModel->save();
|
||||
} catch (\Exception $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace database\seeders;
|
||||
|
||||
use app\admin\model\VideoInfoSeoModel;
|
||||
|
||||
class VideoSeoSeeder
|
||||
{
|
||||
static public function handle()
|
||||
{
|
||||
$arrData = [
|
||||
|
||||
[
|
||||
'vis_name' => '哪吒2',
|
||||
'v_id' => '33572',
|
||||
],
|
||||
[
|
||||
'vis_name' => '哪吒之魔童闹海票房',
|
||||
'v_id' => '33572',
|
||||
],
|
||||
[
|
||||
'vis_name' => '哪吒之魔童闹海最新票房',
|
||||
'v_id' => '33572',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($arrData as $arrDataOne) {
|
||||
$arrDataOne['vis_md5'] = md5($arrDataOne['vis_name'] . $arrDataOne['v_id']);
|
||||
$VideoInfoSeoModel = VideoInfoSeoModel::where('vis_md5', $arrDataOne['vis_md5'])->find();
|
||||
if (empty($VideoInfoSeoModel)) {
|
||||
VideoInfoSeoModel::insert($arrDataOne);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user