| xqd
@@ -48,7 +48,7 @@ class AiController extends Controller
|
|
|
'age' => $request->post('age', ''),
|
|
|
'star' => $request->post('star', ''),
|
|
|
'level' => $request->post('level', ''),
|
|
|
- 'is_piny' => $request->post('is_piny', 1),
|
|
|
+// 'is_piny' => $request->post('is_piny', 1),
|
|
|
]);
|
|
|
if (!$role) {
|
|
|
return Response::fail('提交失败,请稍后再试!');
|
| xqd
@@ -62,6 +62,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
@@ -328,7 +329,7 @@ class AiController extends Controller
|
|
|
$file_name = md5(time()) . '.png';
|
|
|
}
|
|
|
$path = public_path() . '/images/' . $file_name;
|
|
|
- $shell = 'wkhtmltoimage https://t18.9026.com/api/ai/Pinyin?id=' . $task->id . ' ' . $path;
|
|
|
+ $shell = 'wkhtmltoimage https://hb.swdz.com/api/ai/Pinyin?id=' . $task->id . ' ' . $path;
|
|
|
exec($shell, $result, $status);
|
|
|
if ($status) {
|
|
|
$this->exit_out('生成图片失败', ['生成图片失败' => [$shell, $result, $status]]);
|
| xqd
@@ -369,7 +370,7 @@ class AiController extends Controller
|
|
|
$file_name = md5(time()) . '.pdf';
|
|
|
}
|
|
|
$path = public_path() . '/pdf/' . $file_name;
|
|
|
- $shell = 'wkhtmltopdf https://t18.9026.com/api/ai/Pinyin?id=' . $task->id . ' ' . $path;
|
|
|
+ $shell = 'wkhtmltopdf https://hb.swdz.com/api/ai/Pinyin?id=' . $task->id . ' ' . $path;
|
|
|
exec($shell, $result, $status);
|
|
|
if ($status) {
|
|
|
$this->exit_out('生成PDF失败', ['生成PDF失败' => [$shell, $result, $status]]);
|
| xqd
@@ -551,18 +552,24 @@ 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'>";
|
|
|
- $string = $string . "<span>{$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"';
|
|
|
// }
|
|
|
-// $string = $string . '<span ' . $style . "><sup>{$value}</sup>{$splitCharacters[$key]}</span>";
|
|
|
- $string = $string . '<span ' . $style . ">{$splitCharacters[$key]}</span>";
|
|
|
+ if ($result->is_piny){
|
|
|
+ $string = $string . '<span ' . $style . "><sup>{$value}</sup>{$splitCharacters[$key]}</span>";
|
|
|
+ }else{
|
|
|
+ $string = $string . '<span ' . $style . ">{$splitCharacters[$key]}</span>";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return $string;
|
|
|
}
|
|
|
}
|