main bug 修复

This commit is contained in:
wangjinlei
2025-06-03 17:37:43 +08:00
parent 09946318f4
commit 5d642f621c
2 changed files with 25 additions and 18 deletions

View File

@@ -2316,17 +2316,17 @@ class Article extends Base
}
public function testArticleImageEx(){
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$this->addArticleMainEx($data['article_id']);
return jsonSuccess([]);
}
// public function testArticleImageEx(){
// $data = $this->request->post();
// $rule = new Validate([
// "article_id"=>"require"
// ]);
// if(!$rule->check($data)){
// return jsonError($rule->getError());
// }
// $this->addArticleMainEx($data['article_id']);
// return jsonSuccess([]);
// }
public function getArticleImages(){

View File

@@ -414,13 +414,13 @@ class Base extends Controller
//将主体内容写入数据库
foreach ($frag['main'] as $v) {
$ca['p_article_id'] = $p_article_id;
$ca['content'] = $v;
$ca['content_g'] = '';
$ca['ctime'] = time();
$this->production_article_main_obj->insert($ca);
}
// foreach ($frag['main'] as $v) {
// $ca['p_article_id'] = $p_article_id;
// $ca['content'] = $v;
// $ca['content_g'] = '';
// $ca['ctime'] = time();
// $this->production_article_main_obj->insert($ca);
// }
return jsonSuccess([]);
}
@@ -428,6 +428,13 @@ class Base extends Controller
public function addArticleMainEx($article_id){
$article_info = $this->article_obj->where('article_id', $article_id)->find();
$check = $this->article_main_obj->where("article_id",$article_id)->whereIn("state",[0,2])->find();
if($check){
return ;
}
$files = $this->article_file_obj
->where('article_id', $article_info['article_id'])
->where('type_name', 'manuscirpt')