This commit is contained in:
wangjinlei
2021-06-15 10:34:52 +08:00
parent b79316e8d9
commit 7d216a169d
7 changed files with 663 additions and 42 deletions

View File

@@ -141,7 +141,19 @@ class Article extends Controller {
$data = $this->request->post();
$insert_author['article_id'] = $data['article_id'];
$insert_author['author_name'] = $data['author_name'];
$insert_author['author_name'] = trim($data['author_name']);
//处理名字
$ca = explode(' ', $insert_author['author_name']);
$caf = '';
$cal = '';
if(isset($ca[0])){
$caf = str_replace('-', '', $ca[0]);
}
if(isset($ca[1])){
$cal = $ca[1];
}
$insert_author['first_name'] = $caf;
$insert_author['last_name'] = $cal;
$insert_author['author_country'] = $data['author_country'];
$insert_author['is_first'] = $data['is_first'];
$insert_author['is_report'] = $data['is_report'];
@@ -195,7 +207,20 @@ class Article extends Controller {
// $data['organs'] = ['1','2','3'];
$old_article_author_info = $this->article_author_obj->where('article_author_id',$data['article_author_id'])->find();
$update_author['author_name'] = $data['author_name'];
$update_author['author_name'] = trim($data['author_name']);
//处理名字
$ca = explode(' ', $update_author['author_name']);
$caf = '';
$cal = '';
if(isset($ca[0])){
$caf = str_replace('-', '', $ca[0]);
}
if(isset($ca[1])){
$cal = $ca[1];
}
$update_author['first_name'] = $caf;
$update_author['last_name'] = $cal;
$update_author['author_country'] = $data['author_country'];
$update_author['is_first'] = $data['is_first'];
$update_author['is_report'] = $data['is_report'];
@@ -698,6 +723,23 @@ class Article extends Controller {
return json(['code'=>1,'msg'=>'system error']);
}
}
public function mycc(){
$list = $this->article_author_obj->where('article_author_id','>',5126)->select();
foreach ($list as $v){
$ca = explode(' ', $v['author_name']);
$caf = '';
$cal = '';
if(isset($ca[0])){
$caf = str_replace('-', '', $ca[0]);
}
if(isset($ca[1])){
$cal = $ca[1];
}
$this->article_author_obj->where('article_author_id',$v['article_author_id'])->update(['first_name'=>$caf,'last_name'=>$cal]);
}
echo 'over';
}
/**
* @title 图片上传