|
@@ -143,12 +143,14 @@ class DeepSeekController extends BaseController
|
|
// 判断是否有待更新数据,有则查询
|
|
// 判断是否有待更新数据,有则查询
|
|
$ids = Redis::smembers($redis_key);
|
|
$ids = Redis::smembers($redis_key);
|
|
if (count($ids) > 0) {
|
|
if (count($ids) > 0) {
|
|
|
|
+ \Log::info('有更新数据,开始查询');
|
|
$count = DB::table('mp_chapter_paragraph_audios')->whereIn('id', $ids)->where(function($query) {
|
|
$count = DB::table('mp_chapter_paragraph_audios')->whereIn('id', $ids)->where(function($query) {
|
|
return $query->where('generate_status', '!=', '制作中')->orWhere('error_msg', '!=', '');
|
|
return $query->where('generate_status', '!=', '制作中')->orWhere('error_msg', '!=', '');
|
|
})->count('id');
|
|
})->count('id');
|
|
|
|
|
|
// 如果有更新数据,则发送消息
|
|
// 如果有更新数据,则发送消息
|
|
if ($count > 0) {
|
|
if ($count > 0) {
|
|
|
|
+ \Log::info("message: {$count}条数据更新");
|
|
// 查询更新后的信息
|
|
// 查询更新后的信息
|
|
$paragraph_urls = DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('version_id', $version_id)
|
|
$paragraph_urls = DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('version_id', $version_id)
|
|
->where('cid', $cid)->where(function($query) {
|
|
->where('cid', $cid)->where(function($query) {
|
|
@@ -161,8 +163,7 @@ class DeepSeekController extends BaseController
|
|
foreach ($paragraph_urls as $item) {
|
|
foreach ($paragraph_urls as $item) {
|
|
$rem_ids[] = getProp($item, 'id');
|
|
$rem_ids[] = getProp($item, 'id');
|
|
}
|
|
}
|
|
- // 删除有数据的id
|
|
|
|
- Redis::srem($redis_key, $rem_ids);
|
|
|
|
|
|
+ \Log::info("rem_ids: ".json_encode($rem_ids));
|
|
|
|
|
|
// 发送消息
|
|
// 发送消息
|
|
$this->sendEvent([
|
|
$this->sendEvent([
|
|
@@ -173,6 +174,10 @@ class DeepSeekController extends BaseController
|
|
// 'type' => 'update',
|
|
// 'type' => 'update',
|
|
// 'timestamp' => date('H:i:s')
|
|
// 'timestamp' => date('H:i:s')
|
|
]);
|
|
]);
|
|
|
|
+
|
|
|
|
+ // 删除有数据的id
|
|
|
|
+ $result = Redis::srem($redis_key, $rem_ids);
|
|
|
|
+ \Log::info("删除成功: ".$result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|