自动推广

This commit is contained in:
wangjinlei
2026-04-03 11:45:45 +08:00
parent 22947a56a4
commit a802b2e923
11 changed files with 2240 additions and 36 deletions

View File

@@ -6,6 +6,7 @@ use app\api\controller\Base;
use think\Db;
use PhpOffice\PhpWord\IOFactory;
use think\Exception;
use think\Validate;
use \app\common\ArticleParserService;
/**
* @title 自动投稿控制器
@@ -102,6 +103,23 @@ class Contribute extends Base
return $result;
}
public function myTestArticle(){
$data = $this->request->post();
$rule = new Validate([
'article_id'=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$files = $this->article_file_obj->where("article_id",$data['article_id'])->where("type_name","manuscirpt")->order("file_id desc")->limit(1)->select();
$sFileUrl =$files[0]['file_url'];
$sFileUrl = rtrim(ROOT_PATH,'/').'/public/'.ltrim(ltrim($sFileUrl,'/'),'public');
$res = ArticleParserService::getReferencesFromWord($sFileUrl);
return jsonSuccess($res);
}
/**
* 组装数据插入相关数据表
* @param array $aParam