瀏覽代碼

更新显示拼音

王大坤 1 年之前
父節點
當前提交
31dbc67808
共有 13 個文件被更改,包括 26 次插入7 次删除
  1. 二進制
      .DS_Store
  2. 1 1
      .idea/php.xml
  3. 二進制
      app/.DS_Store
  4. 24 5
      app/Http/Controllers/V1/Ai/AiController.php
  5. 1 1
      app/Models/TaskList.php
  6. 二進制
      database/.DS_Store
  7. 二進制
      lang/.DS_Store
  8. 二進制
      public/.DS_Store
  9. 二進制
      resources/.DS_Store
  10. 二進制
      storage/.DS_Store
  11. 二進制
      tests/.DS_Store
  12. 二進制
      vendor/.DS_Store
  13. 二進制
      vendor/dcat/.DS_Store

二進制
.DS_Store


+ 1 - 1
.idea/php.xml

xqd
@@ -186,7 +186,7 @@
       <path value="$PROJECT_DIR$/vendor/socialiteproviders/weixin" />
     </include_path>
   </component>
-  <component name="PhpProjectSharedConfiguration" php_language_level="7.4">
+  <component name="PhpProjectSharedConfiguration" php_language_level="7.3">
     <option name="suggestChangeDefaultLanguageLevel" value="false" />
   </component>
   <component name="PhpStanOptionsConfiguration">

二進制
app/.DS_Store


+ 24 - 5
app/Http/Controllers/V1/Ai/AiController.php

xqd xqd xqd 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('提交失败,请稍后再试!');
@@ -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('任务提交失败');
@@ -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);
@@ -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;

+ 1 - 1
app/Models/TaskList.php

xqd
@@ -8,7 +8,7 @@ class TaskList extends Model
 {
     protected $table    = 'task_list';
     protected $fillable = ['user_id', 'title', 'role_id', 'content', 'created_at', 'updated_at', 'state', 'image', 'init_content', 'keyword', 'sd_image',
-        'desc', 'sd_id', 'surplus_diamond', 'nickname', 'plot', 'is_handpick', 'sort', 'pinyin_content', 'pdf_path', 'image_path'];
+        'desc', 'sd_id', 'surplus_diamond', 'nickname', 'plot', 'is_handpick', 'sort', 'pinyin_content', 'pdf_path', 'image_path','is_piny'];
     public static $state = [
         0 => '已提交',
         1 => '生成中',

二進制
database/.DS_Store


二進制
lang/.DS_Store


二進制
public/.DS_Store


二進制
resources/.DS_Store


二進制
storage/.DS_Store


二進制
tests/.DS_Store


二進制
vendor/.DS_Store


二進制
vendor/dcat/.DS_Store