正在显示
1 个修改的文件
包含
18 行增加
和
12 行删除
@@ -48,22 +48,28 @@ class HotMailArchive { | @@ -48,22 +48,28 @@ class HotMailArchive { | ||
48 | 48 | ||
49 | private function run($id):int { | 49 | private function run($id):int { |
50 | 50 | ||
51 | - $list = $this->db->first(\Model\listsSql::first(dbWhere(['id.>'=>$id,'is_hots'=>1]))); | 51 | + $list = $this->db->all(\Model\listsSql::first(dbWhere(['id.>'=>$id,'is_hots'=>1])).'00'); |
52 | if(!$list){ | 52 | if(!$list){ |
53 | return 0; | 53 | return 0; |
54 | } | 54 | } |
55 | - _echo('正在移动 '.$list['id']); | ||
56 | - try { | ||
57 | - $ret = $this->db->throw()->insert('lists_hot',$list,false); | ||
58 | - }catch (Throwable $e){ | ||
59 | - $this->db->delete('lists_hot',['id'=>$list['id']]); | ||
60 | - | ||
61 | - $ret = $this->db->throw()->insert('lists_hot',$list,false); | 55 | + _echo('正在移动 '.$id); |
56 | + foreach ($list as $item){ | ||
57 | + try { | ||
58 | + $ret = $this->db->throw()->insert('lists_hot',$item,false); | ||
59 | + }catch (Throwable $e){ | ||
60 | + $this->db->delete('lists_hot',['id'=>$item['id']]); | ||
61 | + unset($item['updated_at']); | ||
62 | + $ret = $this->db->throw()->insert('lists_hot',$item,false); | ||
63 | + } | ||
64 | + if($ret){ | ||
65 | + $this->db->delete(listsSql::$table,['id'=>$item['id']]); | ||
66 | + } | ||
67 | + if($item['id'] > $id){ | ||
68 | + $id = $item['id']; | ||
69 | + } | ||
62 | } | 70 | } |
63 | - if($ret){ | ||
64 | - $this->db->delete(listsSql::$table,['id'=>$list['id']]); | ||
65 | - } | ||
66 | - return $list['id']; | 71 | + |
72 | + return $id; | ||
67 | 73 | ||
68 | } | 74 | } |
69 | 75 |
-
请 注册 或 登录 后发表评论