This commit is contained in:
wangjinlei
2025-02-11 09:19:24 +08:00
parent fb647bd6fa
commit aff3123377
6 changed files with 68 additions and 13 deletions

View File

@@ -84,6 +84,8 @@ class Base extends Controller
protected $order_obj = ""; protected $order_obj = "";
protected $article_main_log_obj = ""; protected $article_main_log_obj = "";
protected $article_main_check_obj = ""; protected $article_main_check_obj = "";
protected $major_to_user_obj = "";
protected $major_to_article_obj = "";
public function __construct(\think\Request $request = null) public function __construct(\think\Request $request = null)
@@ -163,6 +165,8 @@ class Base extends Controller
$this->order_obj = Db::name("order"); $this->order_obj = Db::name("order");
$this->article_main_log_obj = Db::name("article_main_log"); $this->article_main_log_obj = Db::name("article_main_log");
$this->article_main_check_obj = Db::name("article_main_check"); $this->article_main_check_obj = Db::name("article_main_check");
$this->major_to_user_obj = Db::name("major_to_user");
$this->major_to_article_obj = Db::name("major_to_article");
} }

View File

@@ -203,8 +203,8 @@ class Monitor extends Base
if($abbr=="PD"&&$year<2024){ if($abbr=="PD"&&$year<2024){
$abbr = "PR"; $abbr = "PR";
} }
$n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->count(); $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("state",">",-1)->count();
$nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("journal_id","<>",$v['journal_id'])->count(); $nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("state",">",-1)->where("journal_id","<>",$v['journal_id'])->count();
$frag[$year] = $n."/".$nj; $frag[$year] = $n."/".$nj;
$year++; $year++;
} }
@@ -293,8 +293,8 @@ class Monitor extends Base
while ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){ while ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1"); $s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1; $e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("state",">",-1)->count();
$nj = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); $nj = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("state",">",-1)->where("journal_id","<>",$v['journal_id'])->count();
$frag[$year."-".$month] = $n."/".$nj; $frag[$year."-".$month] = $n."/".$nj;
if($month==12){ if($month==12){
$year++; $year++;

View File

@@ -757,14 +757,14 @@ class Preaccept extends Base
$am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find(); $am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find();
//上一行,空行 //上一行,空行
$p_list = $this->article_main_obj->where("article_id",$am_info['article_id'])->where("sort","<",$am_info['sort'])->whereIn("state",[0,2])->order("sort desc")->limit(1)->select(); $p_list = $this->article_main_obj->where("article_id",$am_info['article_id'])->where("sort","<",$am_info['sort'])->whereIn("state",[0,2])->order("sort desc")->limit(1)->select();
if($p_list[0]['type']>0||$p_list[0]['content']!=""){ if($p_list&&($p_list[0]['type']>0||$p_list[0]['content']!="")){
$this->addBRow($am_info['article_id'],$p_list[0]['am_id']); $this->addBRow($am_info['article_id'],$p_list[0]['am_id']);
} }
$n_list = $this->article_main_obj->where("article_id",$am_info['article_id'])->where("sort",">",$am_info['sort'])->whereIn("state",[0,2])->order("sort asc")->limit(1)->select(); $n_list = $this->article_main_obj->where("article_id",$am_info['article_id'])->where("sort",">",$am_info['sort'])->whereIn("state",[0,2])->order("sort asc")->limit(1)->select();
if($n_list[0]['type']>0||$n_list[0]['content']!=""){ if($n_list[0]['type']>0||$n_list[0]['content']!=""){
$this->addBRow($am_info['article_id'],$data['am_id']); $this->addBRow($am_info['article_id'],$data['am_id']);
} }
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>1,"content"=>"<b><i>".$am_info['content']."</i></b>"]); $this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>1,"is_h2"=>0,"is_h3"=>0,"content"=>"<b><i>".$am_info['content']."</i></b>"]);
return jsonSuccess([]); return jsonSuccess([]);
} }
@@ -779,10 +779,10 @@ class Preaccept extends Base
$am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find(); $am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find();
//上一行,空行 //上一行,空行
$p_list = $this->article_main_obj->where("article_id",$am_info['article_id'])->where("sort","<",$am_info['sort'])->whereIn("state",[0,2])->order("sort desc")->limit(1)->select(); $p_list = $this->article_main_obj->where("article_id",$am_info['article_id'])->where("sort","<",$am_info['sort'])->whereIn("state",[0,2])->order("sort desc")->limit(1)->select();
if($p_list[0]['type']>0||$p_list[0]['content']!=""){ if($p_list&&($p_list[0]['type']>0||$p_list[0]['content']!="")){
$this->addBRow($am_info['article_id'],$p_list[0]['am_id']); $this->addBRow($am_info['article_id'],$p_list[0]['am_id']);
} }
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h2"=>1,"content"=>"<b>".$am_info['content']."</b>"]); $this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>1,"is_h3"=>0,"content"=>"<b>".$am_info['content']."</b>"]);
return jsonSuccess([]); return jsonSuccess([]);
} }
@@ -795,7 +795,7 @@ class Preaccept extends Base
return jsonError($rule->getError()); return jsonError($rule->getError());
} }
$am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find(); $am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find();
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h3"=>1,"content"=>"<b>".$am_info['content']."</b>"]); $this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>0,"is_h3"=>1,"content"=>"<b>".$am_info['content']."</b>"]);
return jsonSuccess([]); return jsonSuccess([]);
} }

View File

@@ -180,7 +180,15 @@ class Publish extends Base
$pra = []; $pra = [];
$pra['article_id'] = $data['article_id']; $pra['article_id'] = $data['article_id'];
$res = object_to_array(json_decode(myPost($url, $pra))); $res = object_to_array(json_decode(myPost($url, $pra)));
$re['detail'] = $res['data']["detail"]; $detail = $res['data']["detail"];
if($detail['html_type']==2){
$product = $this->production_article_obj->where("w_article_id",$data['article_id'])->find();
$check = $this->article_main_obj->where("article_id",$product['article_id'])->find();
$detail['has_html'] = $check?1:0;
}
$re['detail'] = $detail;
return jsonSuccess($re); return jsonSuccess($re);
} }

View File

@@ -54,9 +54,18 @@ class Ucenter extends Base{
->join('t_user_reviewer_info','t_user.user_id = t_user_reviewer_info.reviewer_id','left') ->join('t_user_reviewer_info','t_user.user_id = t_user_reviewer_info.reviewer_id','left')
->where('t_user.user_id',$data['user_id']) ->where('t_user.user_id',$data['user_id'])
->find(); ->find();
//获取用户的领域
$userInfo['baseInfo']['majorshu'] = $userInfo['baseInfo']['major']==0?'':getMajorShu($userInfo['baseInfo']['major']); $userInfo['baseInfo']['majorshu'] = $userInfo['baseInfo']['major']==0?'':getMajorShu($userInfo['baseInfo']['major']);
$userInfo['baseInfo']['majorStr'] = $userInfo['baseInfo']['major']==0?'':getMajorStr($userInfo['baseInfo']['major']); $userInfo['baseInfo']['majorStr'] = $userInfo['baseInfo']['major']==0?'':getMajorStr($userInfo['baseInfo']['major']);
$majors = $this->major_to_user_obj->where("user_id",$data['user_id'])->where("state",0)->select();
foreach ($majors as $k => $v){
$majors[$k]['shu'] = $this->getMajorShu($v['major_id']);
$majors[$k]['str'] = $this->getMajorStr($v['major_id']);
}
$userInfo['baseInfo']['majors'] = $majors;
//cv信息 //cv信息
$cvs = $this->user_cv_obj->where('user_id',$data['user_id'])->where('state',0)->select(); $cvs = $this->user_cv_obj->where('user_id',$data['user_id'])->where('state',0)->select();
$userInfo['cvs'] = $cvs; $userInfo['cvs'] = $cvs;
@@ -557,8 +566,8 @@ class Ucenter extends Base{
if(!$rule->check($data)){ if(!$rule->check($data)){
return jsonError($rule->getError()); return jsonError($rule->getError());
} }
$major = $this->major_obj->where('major_id',$data['major_id'])->find(); $major = $this->major_obj->where('major_id',$data['major_id'])->where("major_state",0)->find();
$major['children'] = $this->major_obj->where('pid',$major['major_id'])->select(); $major['children'] = $this->major_obj->where('pid',$major['major_id'])->where("major_state",0)->select();
$re['major'] = $major; $re['major'] = $major;
return jsonSuccess($re); return jsonSuccess($re);
} }

View File

@@ -1458,6 +1458,40 @@ class User extends Base
return jsonSuccess($re); return jsonSuccess($re);
} }
public function addUserMajor(){
$data = $this->request->post();
$rule = new Validate([
"user_id"=>"require",
"major_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$check = $this->major_to_user_obj->where("user_id",$data['user_id'])->where("major_id",$data['major_id'])->where("state",0)->find();
if($check){
return jsonError("Repeat addition");
}
$insert['user_id'] = $data['user_id'];
$insert['major_id'] = $data['major_id'];
$insert['ctime'] = time();
$this->major_to_user_obj->insert($insert);
return jsonSuccess([]);
}
public function delUserMajor(){
$data = $this->request->post();
$rule = new Validate([
"mtu_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$this->major_to_user_obj->where("mtu_id",$data['mtu_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
/** /**
* 获取用户所有客座专刊 * 获取用户所有客座专刊
*/ */