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

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

parent 57a6c175
...@@ -82,9 +82,9 @@ class AiTryon extends Common ...@@ -82,9 +82,9 @@ class AiTryon extends Common
$user = auth_user(); $user = auth_user();
//开发过程中临时调试代码 //开发过程中临时调试代码
\think\Queue::push('\addons\shopro\job\AiImgGen@exec', ['user' => $user->toArray(), 'id' => 245 ], 'shopro-high'); // \think\Queue::push('\addons\shopro\job\AiImgGen@exec', ['user' => $user->toArray(), 'id' => 245 ], 'shopro-high');
$this->success('推送队列成功777'); // $this->success('推送队列成功777');
exit; // exit;
// $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png'); // $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png');
// 校验商品分类是否在允许试戴分类中 // 校验商品分类是否在允许试戴分类中
......
...@@ -28,15 +28,16 @@ class AiImgGen extends BaseJob ...@@ -28,15 +28,16 @@ class AiImgGen extends BaseJob
$user = $data['user']; $user = $data['user'];
$user_id = isset($user['id']) ? $user['id'] : 0; $user_id = isset($user['id']) ? $user['id'] : 0;
try{ // 开发中的 调试代码
$aiService = new Ai(); // try{
$aiService->sendNotification($user_id, $id); // $aiService = new Ai();
$this->debug_log('消息发送成功666'); // $aiService->sendNotification($user_id, $id);
$job->delete(); // $this->debug_log('消息发送成功666');
} catch (\Exception $e) { // $job->delete();
format_log_error_custom_name($e, '[AI图片发现消息异常]', '', 'gen_ai'); // } catch (\Exception $e) {
} // format_log_error_custom_name($e, '[AI图片发现消息异常]', '', 'gen_ai');
exit; // }
// exit;
$this->debug_log('***************************** '.date('Y-m-d H:i:s'). '[AI图片异步队列]AI图片生成脚本开始 userid '.$user_id.' id:'.$id.' ***********************************'.PHP_EOL); $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 ...@@ -88,7 +89,7 @@ class AiImgGen extends BaseJob
return false; 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); $aiService->sendNotification($user_id, $id);
......
...@@ -19,7 +19,7 @@ class AiVideoRetry extends BaseJob ...@@ -19,7 +19,7 @@ class AiVideoRetry extends BaseJob
// 调试日志 && 自定义日志 // 调试日志 && 自定义日志
private function debug_log($text=''){ private function debug_log($text=''){
debug_echo($text); // debug_echo($text);
custom_log($text, 'gen_ai'); custom_log($text, 'gen_ai');
} }
...@@ -112,7 +112,7 @@ class AiVideoRetry extends BaseJob ...@@ -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()); $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