|
|
|
@ -1082,6 +1082,36 @@ class AutoPackController extends Think
|
|
|
|
|
|
|
|
|
|
public function clearPkg() {
|
|
|
|
|
$client = new ToolOssClient();
|
|
|
|
|
$client->listObjects();
|
|
|
|
|
$marker = '';
|
|
|
|
|
do {
|
|
|
|
|
$list = $client->listObjects('GamePack/', $marker, 100);
|
|
|
|
|
$urls = [];
|
|
|
|
|
foreach ($list->getObjectList() as $obj) {
|
|
|
|
|
$urls[] = '"https://qy-plat.oss-cn-hangzhou.aliyuncs.com/' . $obj->getKey() . '"';
|
|
|
|
|
}
|
|
|
|
|
if (empty($urls)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
$urlsStr = implode(",", $urls);
|
|
|
|
|
|
|
|
|
|
$rows = M("apply", 'tab_')->field('pack_url, game_id')->where("group_id in ({$urlsStr})")->find();
|
|
|
|
|
$packUrls = [];
|
|
|
|
|
$needDelUrls = [];
|
|
|
|
|
foreach ($rows as $row) {
|
|
|
|
|
$packUrls[] = $row['pack_url'];
|
|
|
|
|
if (!in_array($row['game_id'], [282, 283, 277, 273])) {
|
|
|
|
|
$needDelUrls[] = $row['pack_url'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$needDelUrls = array_unique(array_merge($needDelUrls, array_diff($urls, $packUrls)));
|
|
|
|
|
var_dump($needDelUrls);
|
|
|
|
|
|
|
|
|
|
if (empty($list->getNextMarker())) {
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
|
|
|
|
$marker = $list->getNextMarker();
|
|
|
|
|
}
|
|
|
|
|
} while (true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|