pref: 数据同步
This commit is contained in:
@@ -930,7 +930,8 @@ class DataMigration extends Command
|
||||
{
|
||||
$videos = Db::connect('old')
|
||||
->name('video')
|
||||
->where('id', '>', 844)
|
||||
// ->where('id', '>', 844)
|
||||
->where('cid', 'in', array_keys($category_map))
|
||||
->where('country_code', 'in', ['ZH', 'US'])
|
||||
->order(['id' => 'asc'])
|
||||
->cursor();
|
||||
@@ -970,7 +971,16 @@ class DataMigration extends Command
|
||||
'seo_desc' => $val['seo_description'],
|
||||
'deleted_at' => $val['stat'] == -1 ? date('Y-m-d H:i:s') : null
|
||||
];
|
||||
$ret = Db::name('video')
|
||||
->where('language_id', '=', $item['language_id'])
|
||||
->where('name', '=', $item['name'])
|
||||
->find();
|
||||
if (empty($ret)) {
|
||||
Db::name('video')->insert($item);
|
||||
} else {
|
||||
Db::name('video')->where('id', '=', $ret['id'])->update($item);
|
||||
}
|
||||
|
||||
$this->println('迁移视频ID:' . $val['id']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user