作者 zhl

Merge remote-tracking branch 'origin/master' into zhl

@@ -81,8 +81,8 @@ class Common @@ -81,8 +81,8 @@ class Common
81 $content = str_replace('$keyword$', $param['keywords'], $info['ai']); 81 $content = str_replace('$keyword$', $param['keywords'], $info['ai']);
82 $data = [ 82 $data = [
83 'messages'=>[ 83 'messages'=>[
84 - ['role'=>'system','content'=>$info['scene']],  
85 - ['role'=>'assistant','content'=>$content.$str], 84 +// ['role'=>'system','content'=>$info['scene']],
  85 + ['role'=>'user','content'=>$content.$str],
86 ] 86 ]
87 ]; 87 ];
88 return http_post($url,json_encode($data)); 88 return http_post($url,json_encode($data));
@@ -12,7 +12,7 @@ use App\Models\Ai\AiLog; @@ -12,7 +12,7 @@ use App\Models\Ai\AiLog;
12 class AiCommandController extends BaseController 12 class AiCommandController extends BaseController
13 { 13 {
14 //获取文本内容 14 //获取文本内容
15 - public $chat_url = 'v2/openai_chat'; 15 + public $chat_url = 'v2/openai_chat_qqs';
16 /** 16 /**
17 * @name :ai生成 17 * @name :ai生成
18 * @author :liyuhang 18 * @author :liyuhang
@@ -68,6 +68,7 @@ class BTemplateLogic extends BaseLogic @@ -68,6 +68,7 @@ class BTemplateLogic extends BaseLogic
68 if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页 68 if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页
69 $TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']); 69 $TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']);
70 } 70 }
  71 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($TemplateInfo['html'], true) . PHP_EOL, FILE_APPEND);
71 return $this->success($TemplateInfo); 72 return $this->success($TemplateInfo);
72 } 73 }
73 74
@@ -105,7 +106,7 @@ class BTemplateLogic extends BaseLogic @@ -105,7 +106,7 @@ class BTemplateLogic extends BaseLogic
105 $TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]); 106 $TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]);
106 }else{ 107 }else{
107 $commonTemplateModel = new BTemplateCommon(); 108 $commonTemplateModel = new BTemplateCommon();
108 - $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>$source]); 109 + $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]);
109 if($commonInfo !== false){ 110 if($commonInfo !== false){
110 $TemplateInfo['html'] = $commonInfo['head_css'].$TemplateInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. 111 $TemplateInfo['html'] = $commonInfo['head_css'].$TemplateInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other'].
111 $commonInfo['head_html'].$TemplateInfo['main_html'].$commonInfo['footer_html']; 112 $commonInfo['head_html'].$TemplateInfo['main_html'].$commonInfo['footer_html'];