|
@@ -666,7 +666,7 @@ class DeepSeekService
|
|
|
Utils::throwError('20003:消息不能为空');
|
|
Utils::throwError('20003:消息不能为空');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $json = json_decode($products, 256);
|
|
|
|
|
|
|
+ $json = json_encode($products, 256);
|
|
|
|
|
|
|
|
// 批量插入数据
|
|
// 批量插入数据
|
|
|
return DB::table('mp_script_records')->where('id', $rid)->update([
|
|
return DB::table('mp_script_records')->where('id', $rid)->update([
|
|
@@ -684,6 +684,7 @@ class DeepSeekService
|
|
|
public function getScriptChatHistory($data) {
|
|
public function getScriptChatHistory($data) {
|
|
|
$uid = Site::getUid();
|
|
$uid = Site::getUid();
|
|
|
$script_id = getProp($data, 'script_id');
|
|
$script_id = getProp($data, 'script_id');
|
|
|
|
|
+ $rid = getProp($data, 'rid');
|
|
|
$sequence = getProp($data, 'sequence', null);
|
|
$sequence = getProp($data, 'sequence', null);
|
|
|
|
|
|
|
|
if (!$script_id) {
|
|
if (!$script_id) {
|
|
@@ -710,6 +711,11 @@ class DeepSeekService
|
|
|
$query->where('sequence', $sequence);
|
|
$query->where('sequence', $sequence);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 记录ID筛选
|
|
|
|
|
+ if ($rid) {
|
|
|
|
|
+ $query->where('id', $rid);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 查询记录并按 id 正序排序
|
|
// 查询记录并按 id 正序排序
|
|
|
$records = $query->select('id', 'script_id', 'sequence', 'role', 'content', 'products', 'created_at')
|
|
$records = $query->select('id', 'script_id', 'sequence', 'role', 'content', 'products', 'created_at')
|
|
|
->orderBy('created_at', 'asc')
|
|
->orderBy('created_at', 'asc')
|