Your Name 5 months ago
parent
commit
f1f59a3e00
1 changed files with 14 additions and 6 deletions
  1. 14
    6
      application/api/controller/Ai.php

+ 14
- 6
application/api/controller/Ai.php View File

@@ -420,12 +420,7 @@ class Ai extends MemberApi
420 420
             return [0,$desc,$data];
421 421
         }
422 422
 
423
-        //12.判断是否合法 同时存在触发词和并发词
424
-        [$is_bh1,$fc1] = $this->isInRule($data['cfc'],$line);
425
-        [$is_bh2,$fc2] = $this->isInRule($data['bfc'],$line);
426
-
427
-
428
-        //13.替换指令的变量
423
+        //12.替换指令的变量
429 424
         //var_dump($data['zlj']);die;
430 425
         if(!empty($data['zlj'])){
431 426
             $zlj = json_decode($data['zlj'],true);
@@ -444,6 +439,17 @@ class Ai extends MemberApi
444 439
             //var_dump($zlj_new_json);die;
445 440
         }
446 441
 
442
+        //13.判断是否合法 同时存在触发词和并发词
443
+        //增加判断可以不存在并发词和触发词
444
+        //只需要匹配 包含主词即可通过
445
+        if(!empty($data['cfc']) && (string)$data['cfc'] != '0'){
446
+            [$is_bh1,$fc1] = $this->isInRule($data['cfc'],$line);
447
+            [$is_bh2,$fc2] = $this->isInRule($data['bfc'],$line);
448
+        }else{
449
+            $desc .= '不需要验证并发词和触发词,合法';
450
+            return [1,$desc,$data];
451
+        }
452
+
447 453
         if($is_bh1 > 0 && $is_bh2 > 0){
448 454
             //同时存在
449 455
             $desc .= '同时存在并发词['.$fc2.']和触发词['.$fc1.']合法';
@@ -656,6 +662,8 @@ class Ai extends MemberApi
656 662
                     'lyjlid' => $row['id'], //来源id
657 663
                     'sblx' => 3,//设别类型 电脑A
658 664
                     'is_sc' => 0, //是否生成文章
665
+                    'pic_html' => '0',
666
+                    'imgs' => '{}'
659 667
                 ];
660 668
                 $run = Db::name('cms_ai')->insert($data);
661 669
                 Db::name('cms_zl')->where('id',$row['id'])->update(['is_cf'=>2]); //已检测 同步

Loading…
Cancel
Save