Commit 916986bf authored by 刘小敏's avatar 刘小敏

AI生成视频接口优化

parent 0fac941e
......@@ -193,6 +193,8 @@ class AiTryon extends Common
*/
public function genVideo()
{
if (!$this->request->isPost()) {
$this->error('请用post方式请求');
}
......@@ -238,7 +240,7 @@ class AiTryon extends Common
$tryonData['ai_status'] = 2;
$tryonData['ai_err_msg'] = $res['msg'];
$tryonModel->save($tryonData);
$tryonModel->insertGetId($tryonData);
$this->error($res['msg']);
......@@ -247,12 +249,11 @@ class AiTryon extends Common
// 保存一条 我的试戴
$tryonData['ai_status'] = 0;
$tryonData['ai_task_id'] = isset($res['data']) ? $res['data'] : '';
$tryonModel->save($tryonData);
$id = $tryonModel->id;
$id = $tryonModel->insertGetId($tryonData);
//试戴次数+1
$userService = new User();
$res = $userService->addTryTimes($user->id);
$userService->addTryTimes($user->id);
// 推送队列
\think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => $res['data'], 'user' => $user], 'shopro-high');
......
......@@ -929,5 +929,6 @@ if (!function_exists('debug_echo')) {
function debug_echo($text='')
{
echo PHP_EOL . '------' . $text . '------' . PHP_EOL ;
\think\Log::info($text);
}
}
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