1
This commit is contained in:
@@ -869,6 +869,30 @@ function getMajorShu($major)
|
||||
return $p . ',' . $res['major_id'];
|
||||
}
|
||||
|
||||
|
||||
function changeArticleMajor($article_id,$majors){
|
||||
$ms = explode(",",$majors);
|
||||
$major_to_article_obj = Db::name("major_to_article");
|
||||
foreach ($ms as $v){
|
||||
$check = $major_to_article_obj->where("article_id",$article_id)->where("major_id",$v)->where("state",0)->find();
|
||||
if(!$check){
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['major_id'] = $v;
|
||||
$insert['ctime'] = time();
|
||||
$major_to_article_obj->insert($insert);
|
||||
}
|
||||
}
|
||||
$has = $major_to_article_obj->where("article_id",$article_id)->where("state",0)->select();
|
||||
foreach ($has as $v){
|
||||
if(!in_array($v['major_id'],$ms)){
|
||||
$major_to_article_obj->where("mta_id",$v['mta_id'])->update(['state'=>1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getReviewerCvs($reviewer_id){
|
||||
$cvs = Db::name('user_cv')->where('user_id',$reviewer_id)->where('state',0)->select();
|
||||
return $cvs;
|
||||
|
||||
Reference in New Issue
Block a user