| xqd
@@ -49,6 +49,7 @@ class AiController extends Controller
|
|
|
'age' => $request->post('age', ''),
|
|
|
'star' => $request->post('star', ''),
|
|
|
'level' => $request->post('level', ''),
|
|
|
+
|
|
|
]);
|
|
|
if (!$role) {
|
|
|
return Response::fail('提交失败,请稍后再试!');
|
| xqd
@@ -62,6 +63,7 @@ class AiController extends Controller
|
|
|
'surplus_diamond' => Auth::$user->diamond - $plot,
|
|
|
'nickname' => 'AI绘本生成',
|
|
|
'plot' => $plot,
|
|
|
+ 'is_piny' => $request->post('pinYin', 1),
|
|
|
]);
|
|
|
if (!$task) {
|
|
|
return Response::fail('任务提交失败');
|
| xqd
@@ -492,7 +494,6 @@ class AiController extends Controller
|
|
|
$pdfPath = $domain . '/file/pdf/' . $date.'/'.$file_name;
|
|
|
$task->pdf_path = $pdfPath;
|
|
|
$task->save();
|
|
|
-
|
|
|
return Response::success(['url' => $pdfPath]);
|
|
|
} catch (\Exception $exception) {
|
|
|
LogHelper::exceptionLog($exception, $this->code);
|
| xqd
@@ -663,14 +664,32 @@ class AiController extends Controller
|
|
|
$string = $string . $img;
|
|
|
}
|
|
|
if (in_array($key + 1, $arr)) {
|
|
|
- $string = $string . "<span><sup>{$value}</sup>{$splitCharacters[$key]}</span><br style='clear: both'><br style='clear: both'>";
|
|
|
+ if ($result->is_piny){
|
|
|
+ $string = $string . "<span><sup>{$value}</sup>{$splitCharacters[$key]}</span><br style='clear: both'><br style='clear: both'>";
|
|
|
+ }else{
|
|
|
+ $string = $string . "<span>{$splitCharacters[$key]}</span><br style='clear: both'><br style='clear: both'>";
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
$style = '';
|
|
|
- if (in_array($key, $arr) || 0 == $key) {
|
|
|
- $style = 'style="margin-left: 5rem"';
|
|
|
+ if (in_array($key, $arr) || 0 == $key) {
|
|
|
+ $style = 'style="margin-left: 5rem"';
|
|
|
+ }
|
|
|
+ if ($result->is_piny){
|
|
|
+ $string = $string . '<span ' . $style . "><sup>{$value}</sup>{$splitCharacters[$key]}</span>";
|
|
|
+ }else{
|
|
|
+ $string = $string . '<span ' . $style . ">{$splitCharacters[$key]}</span>";
|
|
|
}
|
|
|
- $string = $string . '<span ' . $style . "><sup>{$value}</sup>{$splitCharacters[$key]}</span>";
|
|
|
}
|
|
|
+// if (in_array($key + 1, $arr)) {
|
|
|
+// $string = $string . "<span><sup>{$value}</sup>{$splitCharacters[$key]}</span><br style='clear: both'><br style='clear: both'>";
|
|
|
+// } else {
|
|
|
+// $style = '';
|
|
|
+// if (in_array($key, $arr) || 0 == $key) {
|
|
|
+// $style = 'style="margin-left: 5rem"';
|
|
|
+// }
|
|
|
+// $string = $string . '<span ' . $style . "><sup>{$value}</sup>{$splitCharacters[$key]}</span>";
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
return $string;
|