Commit 0bd60672 by haojie

1

parent 088559f8
......@@ -45,7 +45,8 @@ public function submit($user_id, array $data = [])
'prompt' => $prompt,
'prompt_img' => $prompt_img,
'user_id' => $user_id,
'prompt_num' => $prompt_num,
# 'prompt_num' => $prompt_num,
'prompt_num' => 1,
];
# 保存任务
$task_id = Task::query()->create($list)->id;
......@@ -53,7 +54,8 @@ public function submit($user_id, array $data = [])
# 返回任务id
return [
'task_id' => $task_id,
'prompt_num' => $prompt_num
# 测试
'prompt_num' => 1
];
}
......@@ -126,13 +128,13 @@ public function prompt_callback($data = [])
$result_img = $credentials['result_img'];
# 判断必须字段
if (empty($user_id) || empty($task_id) || empty($result_img) || empty($prompt_id)) {
Log::error('参数错误');
return false;
throw new UserException('指令回调缺少参数');
}
# 更新
$res = PromptTask::query()->where('id', $prompt_id)->where('user_id', $user_id)
->where('task_id', $task_id)->update(['result_img' => $result_img,]);
#
Log::info('更新成功');
$list = [
'user_id' => $user_id,
'task_id' => $task_id,
......
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