...
|
...
|
@@ -48,22 +48,28 @@ class HotMailArchive { |
|
|
|
|
|
private function run($id):int {
|
|
|
|
|
|
$list = $this->db->first(\Model\listsSql::first(dbWhere(['id.>'=>$id,'is_hots'=>1])));
|
|
|
$list = $this->db->all(\Model\listsSql::first(dbWhere(['id.>'=>$id,'is_hots'=>1])).'00');
|
|
|
if(!$list){
|
|
|
return 0;
|
|
|
}
|
|
|
_echo('正在移动 '.$list['id']);
|
|
|
_echo('正在移动 '.$id);
|
|
|
foreach ($list as $item){
|
|
|
try {
|
|
|
$ret = $this->db->throw()->insert('lists_hot',$list,false);
|
|
|
$ret = $this->db->throw()->insert('lists_hot',$item,false);
|
|
|
}catch (Throwable $e){
|
|
|
$this->db->delete('lists_hot',['id'=>$list['id']]);
|
|
|
|
|
|
$ret = $this->db->throw()->insert('lists_hot',$list,false);
|
|
|
$this->db->delete('lists_hot',['id'=>$item['id']]);
|
|
|
unset($item['updated_at']);
|
|
|
$ret = $this->db->throw()->insert('lists_hot',$item,false);
|
|
|
}
|
|
|
if($ret){
|
|
|
$this->db->delete(listsSql::$table,['id'=>$list['id']]);
|
|
|
$this->db->delete(listsSql::$table,['id'=>$item['id']]);
|
|
|
}
|
|
|
if($item['id'] > $id){
|
|
|
$id = $item['id'];
|
|
|
}
|
|
|
return $list['id'];
|
|
|
}
|
|
|
|
|
|
return $id;
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|