This commit is contained in:
wangjinlei
2023-05-06 11:25:39 +08:00
parent 42d41a1eac
commit abc75d4520

View File

@@ -158,6 +158,9 @@ class Production extends Base
if(!$rule->check($data)){ if(!$rule->check($data)){
return jsonError($rule->getError()); return jsonError($rule->getError());
} }
$update['content'] = trim($data['content']);
$this->production_article_main_obj->where('p_main_id',$data['p_main_id'])->update($update);
return jsonSuccess([]);
} }
/** /**
@@ -261,23 +264,23 @@ class Production extends Base
return jsonSuccess($re); return jsonSuccess($re);
} }
/** // /**
* 编辑文章主要内容 // * 编辑文章主要内容
*/ // */
public function editMainContent() // public function editMainContent()
{ // {
$data = $this->request->post(); // $data = $this->request->post();
$rule = new Validate([ // $rule = new Validate([
'p_article_id' => 'require|number', // 'p_article_id' => 'require|number',
'main' => 'require' // 'main' => 'require'
]); // ]);
if (!$rule->check($data)) { // if (!$rule->check($data)) {
return jsonError($rule->getError()); // return jsonError($rule->getError());
} // }
$update['main'] = $data['main']; // $update['main'] = $data['main'];
$this->production_article_obj->where('p_article_id', $data['p_article_id'])->update($update); // $this->production_article_obj->where('p_article_id', $data['p_article_id'])->update($update);
return jsonSuccess([]); // return jsonSuccess([]);
} // }
private function createdoi($year, $vol, $abbr) private function createdoi($year, $vol, $abbr)