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)){
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);
}
/**
* 编辑文章主要内容
*/
public function editMainContent()
{
$data = $this->request->post();
$rule = new Validate([
'p_article_id' => 'require|number',
'main' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$update['main'] = $data['main'];
$this->production_article_obj->where('p_article_id', $data['p_article_id'])->update($update);
return jsonSuccess([]);
}
// /**
// * 编辑文章主要内容
// */
// public function editMainContent()
// {
// $data = $this->request->post();
// $rule = new Validate([
// 'p_article_id' => 'require|number',
// 'main' => 'require'
// ]);
// if (!$rule->check($data)) {
// return jsonError($rule->getError());
// }
// $update['main'] = $data['main'];
// $this->production_article_obj->where('p_article_id', $data['p_article_id'])->update($update);
// return jsonSuccess([]);
// }
private function createdoi($year, $vol, $abbr)