修改查询日志参数

This commit is contained in:
chengxl
2025-06-19 14:16:29 +08:00
parent bcc1c353ca
commit 4d844fc5cd

View File

@@ -218,23 +218,6 @@ class Aiarticle extends Base
return json_encode(array('status' => 1,'msg' => 'OPENAI successfully generated content','data' => $aContent));
}
/**
* @title AI生成稿件文章
* @param article_id 文章ID
* @param model 接口模型
* @param stream 是否流式输出 true是false否
*/
public function test(){
//获取参数
$aParam = $this->request->post();
$iArticleId = empty($aParam['article_id']) ? '' : $aParam['article_id'];
if(empty($iArticleId)){
return json_encode(array('status' => 2,'msg' => 'Please select an article' ));
}
//请求OPENAI生成公微内容
Queue::push('app\api\job\ArticleAiCreateContent@fire', ['article_id' => $iArticleId], 'ArticleAiCreateContent');
}
public function create($aParam = []){
//获取参数
$aParam = empty($aParam) ? $this->request->post() : $aParam;
@@ -1554,6 +1537,11 @@ class Aiarticle extends Base
$oMaterial = new Material;
$aLog = json_decode($oMaterial->getWechatLog(['article_id' => $iArticleId,'type' => 1,'status' =>1]),true);
if(!empty($aLog['data'])){
$aLog = json_decode($oMaterial->getWechatLog(['article_id' => $iArticleId,'type' => 2,'status' =>1]),true);
if(empty($aLog['data'])){ //推送到草稿箱
Queue::push('app\api\job\WechatDraft@fire', ['article_id' => $iArticleId], 'WechatDraft');
return json_encode(['status' => 1,'msg' => 'The article material has been pushed into the draft box queue','data' => []]);
}
return json_encode(['status' => 1,'msg' => 'The material has been uploaded','data' => []]);
}