Commit c6c70bf5 authored by 刘小敏's avatar 刘小敏

3D试戴订阅消息优化完结

parent 57a6c175
......@@ -82,9 +82,9 @@ class AiTryon extends Common
$user = auth_user();
//开发过程中临时调试代码
\think\Queue::push('\addons\shopro\job\AiImgGen@exec', ['user' => $user->toArray(), 'id' => 245 ], 'shopro-high');
$this->success('推送队列成功777');
exit;
// \think\Queue::push('\addons\shopro\job\AiImgGen@exec', ['user' => $user->toArray(), 'id' => 245 ], 'shopro-high');
// $this->success('推送队列成功777');
// exit;
// $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png');
// 校验商品分类是否在允许试戴分类中
......
......@@ -28,15 +28,16 @@ class AiImgGen extends BaseJob
$user = $data['user'];
$user_id = isset($user['id']) ? $user['id'] : 0;
try{
$aiService = new Ai();
$aiService->sendNotification($user_id, $id);
$this->debug_log('消息发送成功666');
$job->delete();
} catch (\Exception $e) {
format_log_error_custom_name($e, '[AI图片发现消息异常]', '', 'gen_ai');
}
exit;
// 开发中的 调试代码
// try{
// $aiService = new Ai();
// $aiService->sendNotification($user_id, $id);
// $this->debug_log('消息发送成功666');
// $job->delete();
// } catch (\Exception $e) {
// format_log_error_custom_name($e, '[AI图片发现消息异常]', '', 'gen_ai');
// }
// exit;
$this->debug_log('***************************** '.date('Y-m-d H:i:s'). '[AI图片异步队列]AI图片生成脚本开始 userid '.$user_id.' id:'.$id.' ***********************************'.PHP_EOL);
......@@ -88,7 +89,7 @@ class AiImgGen extends BaseJob
return false;
}
AiTryOnModel::where('id', $id)->where('user_id', $user_id)->update(['ai_status' => 1, 'ai_url' => config('shopro.api_host') . $attachment]);
AiTryOnModel::where('id', $id)->where('user_id', $user_id)->update(['ai_status' => 1, 'ai_err_msg' => '图片已成功', 'ai_url' => config('shopro.api_host') . $attachment]);
// 发送消息通知
$aiService->sendNotification($user_id, $id);
......
......@@ -19,7 +19,7 @@ class AiVideoRetry extends BaseJob
// 调试日志 && 自定义日志
private function debug_log($text=''){
debug_echo($text);
// debug_echo($text);
custom_log($text, 'gen_ai');
}
......@@ -112,7 +112,7 @@ class AiVideoRetry extends BaseJob
}
// 更新我的试戴记录
AiTryOnModel::where('user_id', $user_id)->where('ai_task_id', $taskid)->update(['ai_status' => 1,'ai_url' => config('shopro.api_host').$video_url, 'ai_err_msg' => '视频生成成功']);
AiTryOnModel::where('user_id', $user_id)->where('ai_task_id', $taskid)->update(['ai_status' => 1,'ai_url' => config('shopro.api_host').$video_url, 'ai_err_msg' => '视频已完成']);
$this->debug_log('[AI视频查询异步队列]保存本地视频成功 sql: '.db()->getLastSql());
// 发送成功消息通知
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment