Skip to content

Commit 6ab594b

Browse files
committed
update: 条件
1 parent e0eb32a commit 6ab594b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

laravel/app/Http/Repository/ApiRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function handleAutoTask()
5050
public function handleAutoDelete()
5151
{
5252
// 查询数据库已完成的任务,判断过期条件
53-
$excels = ApiExcel::where('state', 2)->get(['id', 'auto_delete', 'updated_at']);
53+
$excels = ApiExcel::whereIn('state', [2, 5])->get(['id', 'auto_delete', 'updated_at']);
5454

5555
foreach ($excels as $excel) {
5656
if ($excel['auto_delete'] > 0 && strtotime($excel['updated_at']) + $excel['auto_delete'] * 86400 < time()) {

laravel/database/migrations/2019_01_28_205011_create_api_excel_table.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function up()
2727
$table->timestamps();
2828
$table->index('api_param_id', 'index_api_param_id');
2929
$table->index('uid', 'index_uid');
30+
$table->index('state', 'index_state');
3031
});
3132
}
3233

0 commit comments

Comments
 (0)