This commit is contained in:
wangjinlei
2023-02-17 09:28:11 +08:00
parent 689581f685
commit 45a6caadb0
6 changed files with 350 additions and 76 deletions

View File

@@ -948,7 +948,7 @@ class Article extends Controller
//初审分数不够,自动拒稿
if ($article_info['state'] == 0 && $article_info['type'] != 'N' && $article_info['type'] != 'T') {
if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 21 && $article_info['scoring'] < 1) || ($journal_info['journal_id'] == 16 && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 21 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1.5)) {
if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 21 && $article_info['scoring'] < 1) || ($journal_info['journal_id'] == 16 && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 21 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1)) {
if (count($transfer_list) > 0) {
//查询转投期刊信息
$transfer_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();

View File

@@ -11,7 +11,8 @@ use think\Queue;
*
* @author jgll2
*/
class Auto extends Controller {
class Auto extends Controller
{
//put your code here
protected $article_obj = '';
@@ -27,7 +28,8 @@ class Auto extends Controller {
protected $reviewer_info_obj = '';
protected $user_cv_obj = '';
public function __construct(\think\Request $request = null) {
public function __construct(\think\Request $request = null)
{
parent::__construct($request);
$this->article_obj = Db::name('article');
$this->article_reviewer_obj = Db::name('article_reviewer');
@@ -43,22 +45,25 @@ class Auto extends Controller {
$this->user_cv_obj = Db::name('user_cv');
}
public function phpinfo(){
public function phpinfo()
{
phpinfo();
}
public function testEmail() {
public function testEmail()
{
$journal_info = $this->journal_obj->where('journal_id', 4)->find();
$maidata['email'] = "751475802@qq.com";
$maidata['title'] = "test email";
$maidata['content'] = "test content";
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
sendEmail($maidata['email'], $journal_info['title'], $journal_info['title'], $maidata['title'], $journal_info['email'], $journal_info['epassword']);
}
public function resetReviewerPassword() {
public function resetReviewerPassword()
{
$list = $this->user_obj
->field("t_user.*")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_user.user_id", "left")
@@ -72,10 +77,87 @@ class Auto extends Controller {
die;
}
public function pctest1()
{
$url1 = "https://sky.yangtzeu.edu.cn/szdw/zzjs.htm";
$url2 = "https://sky.yangtzeu.edu.cn/szdw/dsyl.htm";
$result1 = self::pcread($url1);
$result2 = self::pcread($url2);
$preg = '/<a .*?href="(.*?)".*?>/is';
preg_match_all($preg, $result1, $array1);
preg_match_all($preg, $result2, $array2);
$arr = array_merge($array1[1],$array2[1]);
$array = [];
foreach ($arr as $v) {
if (stripos($v, '1009')) {
if(!stripos($v,'yangtzeu.edu')){
$array[] = "https://sky.yangtzeu.edu.cn/".substr($v,3);
}else{
$array[] = $v;
}
}
}
$frag = [];
foreach($array as $v){
$res = self::pcread($v);
preg_match('/一、基本信息<\/span>.*?<\/div>/is',$res,$r);
if(!isset($r[0])){
continue;
}
$str = strip_tags($r[0]);
$res_arr = explode(PHP_EOL,$str);
$cache = [];
$chc = [];
foreach($res_arr as $val){
if(stripos($val,'mail')){
$cache['email'] = str_replace("&nbsp;",' ',$val);
}else{
$chc[] = str_replace("&nbsp;",' ',$val);
}
}
$cache['name'] = str_replace("&nbsp;",' ',$res_arr[1]);
$cache['all'] = $chc;
$frag[] = $cache;
}
dump($frag);
// $res = self::pcread($array[1]);
// preg_match('/一、基本信息<\/span>.*?<\/div>/is',$res,$r);
// $str = strip_tags($r[0]);
// $res_arr = explode(PHP_EOL,$str);
// dump(explode(PHP_EOL,$str));
}
public function pcread($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //禁止调用时就输出获取到的数据
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
/**
* 推送邮件给审稿人提醒审稿人
*/
public function pushEmailForReviewer() {
public function pushEmailForReviewer()
{
//筛选数据
$list = $this->article_reviewer_obj->where("state", "in", [0, 5])->select();
foreach ($list as $v) {
@@ -98,7 +180,7 @@ class Auto extends Controller {
$tt .= "We have not yet received a response from you, possibly because the original invitation went astray. We would be grateful if you could let us know if you can carry out this review.<br><br>";
$tt .= '<a href="' . $this->creatLoginUrlForreviewer($cache_reviewer, $v['art_rev_id']) . '">Click here to review the article</a><br>';
$tt .= '<a href="' . $this->creatRejectUrlForReviewer($cache_reviewer, $v['art_rev_id']) . '">Click on the link to reject the review of this manuscript</a><br>';
$tt .= 'Your username:'.$cache_reviewer['account'].'<br><br>';
$tt .= 'Your username:' . $cache_reviewer['account'] . '<br><br>';
$tt .= 'Your original password:123456qwe, if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>' . $cache_journal['title'] . '<br>';
@@ -127,7 +209,8 @@ class Auto extends Controller {
}
}
public function pushTestEmail() {
public function pushTestEmail()
{
$cache_reviewer = $this->user_obj->where('user_id', 54)->find();
$cache_journal = $this->journal_obj->where('journal_id', 1)->find();
$cache_article = $this->article_obj->where("article_id", 1700)->find();
@@ -169,33 +252,36 @@ class Auto extends Controller {
// dump($list);
// }
public function getUserqqqq(){
public function getUserqqqq()
{
$num = $this->request->post('num');
$limit_start = ($num - 1) * 1000;
$users = $this->user_obj->join("t_user_reviewer_info",'t_user_reviewer_info.reviewer_id = t_user.user_id','left')->limit($limit_start,1000)->select();
$users = $this->user_obj->join("t_user_reviewer_info", 't_user_reviewer_info.reviewer_id = t_user.user_id', 'left')->limit($limit_start, 1000)->select();
$re['list'] = $users;
return jsonSuccess($re);
}
public function qqqq(){
public function qqqq()
{
$extension_obj = Db::name('exten');
$data = $this->request->post();
$num = $data['num'];
$limit_start = ($num - 1) * 1000;
$list = $extension_obj->limit($limit_start,1000)->select();
$list = $extension_obj->limit($limit_start, 1000)->select();
$re['list'] = $list;
return jsonSuccess($re);
}
public function pppp(){
public function pppp()
{
$journal_abbr_obj = Db::name('journal_abbr');
$file = "D://bbbb.xlsx";
$res = $this->readExcel($file);
$f = [];
foreach($res as $v){
foreach ($res as $v) {
$cache['full_name'] = $v['full'];
$cache['little_name'] = $v['aa'];
$f[] = $cache;
@@ -206,7 +292,8 @@ class Auto extends Controller {
// $extension_obj->insertAll($res);
}
private function readExcel($path) {
private function readExcel($path)
{
$extension = substr($path, strrpos($path, '.') + 1);
vendor("PHPExcel.PHPExcel");
if ($extension == 'xlsx') {
@@ -224,7 +311,7 @@ class Auto extends Controller {
for ($i = 0; $i <= $highestRow; $i++) {
$full = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
$aa = $objPHPExcel->getActiveSheet()->getCell("B" . $i)->getValue();
if($aa==''){
if ($aa == '') {
continue;
}
// if(!in_array($aa,$frag1)){
@@ -238,7 +325,8 @@ class Auto extends Controller {
return $frag;
}
private function creatLoginUrlForreviewer($user, $article_id) {
private function creatLoginUrlForreviewer($user, $article_id)
{
$code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
@@ -248,7 +336,8 @@ class Auto extends Controller {
return $url;
}
private function creatRejectUrlForReviewer($user, $article_id) {
private function creatRejectUrlForReviewer($user, $article_id)
{
$code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
@@ -263,7 +352,8 @@ class Auto extends Controller {
/**
* 推送邮件提醒作者修回稿件
*/
public function pushEmailForAuthor() {
public function pushEmailForAuthor()
{
//筛选数据
$list = $this->article_obj->where("state", 4)->select();
foreach ($list as $v) {
@@ -346,7 +436,8 @@ class Auto extends Controller {
/**
* 自动审稿主方法
*/
public function initAutoReview() {
public function initAutoReview()
{
//查找对应状态的article列表
$alist = $this->article_obj->where('state', 2)->select();
foreach ($alist as $v) {
@@ -354,15 +445,17 @@ class Auto extends Controller {
}
}
public function testrev() {
public function testrev()
{
$a = $this->article_obj->where('article_id', 261)->find();
// $this->checkrev($a);
// $this->checkrev($a);
}
/**
* 处理过期审稿
*/
public function overdue_reviewer() {
public function overdue_reviewer()
{
die('Temporarily Out of Service');
$where['state'] = 0;
$where['ctime'] = ['lt', time() - 3600 * 24 * 14];
@@ -375,7 +468,8 @@ class Auto extends Controller {
}
}
public function testmail() {
public function testmail()
{
$maidata['email'] = '751475802@qq.com';
$maidata['title'] = 'testdsdsasaddsasdaadsasd' . date('Ymd His', time());
$maidata['content'] = 'dsadsaas';
@@ -384,14 +478,16 @@ class Auto extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
public function mytest() {
public function mytest()
{
echo 'okokokook!!!!';
}
/**
* 审查文章审稿人状态,返回结果
*/
public function checkrev($data) {
public function checkrev($data)
{
die;
//查找审稿案例状态
$rev_list = $this->reviewer_obj->where('article_id', $data['article_id'])->where('state', '<>', 4)->select();
@@ -423,10 +519,10 @@ class Auto extends Controller {
$this->add_reviewer($data);
return true;
} elseif ($all == 2) {
if ($s_num > 0) {//不做任何处理
if ($s_num > 0) { //不做任何处理
return true;
}
if ($p_num == 2) {//通过
if ($p_num == 2) { //通过
//更新文章状态
$this->article_obj->where('article_id', $data['article_id'])->update(['state' => 4, 'editor_act' => 1]);
//添加文章msg信息
@@ -450,19 +546,19 @@ class Auto extends Controller {
$tt .= 'Email: ' . $journal_info['email'] . '<br>';
$tt .= 'Website: ' . $journal_info['website'];
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
} elseif ($np_num == 2) {//不通过
} elseif ($np_num == 2) { //不通过
//发送邮件通知编辑
$tt = 'Reviewers final opinions on the manuscript ID' . $data['accept_sn'] . ' are rejection. Please login and deal with the next step of this manuscript manually.';
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
} else {//一样一个增加一个审稿案例
} else { //一样一个增加一个审稿案例
$this->add_reviewer($data);
return true;
}
} elseif ($all == 3) {
if ($s_num > 0) {//不做任何处理
if ($s_num > 0) { //不做任何处理
return true;
}
if ($p_num == 2) {//通过
if ($p_num == 2) { //通过
//更新文章状态
$this->article_obj->where('article_id', $data['article_id'])->update(['state' => 4, 'editor_act' => 1]);
//添加文章msg信息
@@ -486,7 +582,7 @@ class Auto extends Controller {
$tt .= 'Email: ' . $journal_info['email'] . '<br>';
$tt .= 'Website: ' . $journal_info['website'];
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
} else {//不通过
} else { //不通过
//发送邮件通知编辑
$tt = 'Reviewers final opinions on the manuscript ID' . $data['accept_sn'] . ' are rejection. Please login and deal with the next step of this manuscript manually.';
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
@@ -497,21 +593,22 @@ class Auto extends Controller {
/**
* 增加一个审稿人
*/
public function add_reviewer($article) {
public function add_reviewer($article)
{
$journal_info = $this->journal_obj->where('journal_id', $article['journal_id'])->find();
$editor_info = $this->user_obj->where('user_id', $article['editor_id'])->find();
//根据文章筛选候选人
$reviewer = $this->chose_reviewer($article);
$sendUser=[
'title'=> $journal_info['title'], // 邮件标题
'journal_id'=>$article['journal_id'], // 期刊ID
'sendEmail'=>$journal_info['email'], // 期刊邮箱
'sendPassword'=>$journal_info['epassword'], // 期刊密码
'from_name'=>$journal_info['title']
$sendUser = [
'title' => $journal_info['title'], // 邮件标题
'journal_id' => $article['journal_id'], // 期刊ID
'sendEmail' => $journal_info['email'], // 期刊邮箱
'sendPassword' => $journal_info['epassword'], // 期刊密码
'from_name' => $journal_info['title']
];
if ($reviewer == null) {//没有查询到审稿人,执行提醒操作
if ($reviewer == null) { //没有查询到审稿人,执行提醒操作
//发送邮件到编辑,提醒需要手动添加审稿案例
$tt = 'Dear editor,<br>';
$tt .= 'There are no enough research area related reviewers in the reviewer list for manuscript ID ' . $article['accept_sn'] . ', please add reviewers for your journal or manual deal with this problem.<br><br>';
@@ -522,7 +619,7 @@ class Auto extends Controller {
$sendUser['content'] = $tt;
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
} else {//查询到审稿人,执行添加操作
} else { //查询到审稿人,执行添加操作
//将审稿时间定义至现在
$this->user_obj->where('user_id', $reviewer['user_id'])->update(['rtime' => time()]);
@@ -585,13 +682,14 @@ class Auto extends Controller {
/**
* 筛选一个审稿人
*/
public function chose_reviewer($article) {
public function chose_reviewer($article)
{
//筛选符合期刊
$rev_list = $this->rev_to_jour_obj->where('journal_id', $article['journal_id'])->column('reviewer_id');
$fie_list = $this->reviewer_info_obj->where('major', $article['major_id'])->column('reviewer_id');
$u_list = $this->user_obj
->where('user_id', ['in', $rev_list], ['in', $fie_list])//审核人属于某期刊,并且属于某个领域
->where('rtime', '<', time() - 3600 * 24 * 15)//审核人间隔时间
->where('user_id', ['in', $rev_list], ['in', $fie_list]) //审核人属于某期刊,并且属于某个领域
->where('rtime', '<', time() - 3600 * 24 * 15) //审核人间隔时间
->order('rs_num desc')->select();
if ($u_list) {
return $u_list[0];
@@ -599,5 +697,4 @@ class Auto extends Controller {
return null;
}
}
}

View File

@@ -128,6 +128,24 @@ class Journal extends Controller {
return jsonSuccess($re);
}
public function editJournal(){
$data = $this->request->post();
$rule = new Validate([
'journal_id'=>'require',
'level'=>'require',
'email'=>'require',
'epassword'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$update['level'] = $data['level'];
$update['email'] = $data['email'];
$update['epassword'] = $data['epassword'];
$this->journal_obj->where('journal_id',$data['journal_id'])->update($update);
return jsonSuccess([]);
}
/**
* 获取期刊详情
*/

View File

@@ -1514,18 +1514,23 @@ class Production extends Controller
$authors = $this->production_article_author_obj->where('p_article_id', $p_article_id)->where('state', 0)->select();
//组装地址数组
$address = [];
foreach ($authors as $v) {
$cac = $this->production_article_author_to_organ_obj
->field('t_production_article_organ.*')
->join('t_production_article_organ', 't_production_article_organ.p_article_organ_id = t_production_article_author_to_organ.p_article_organ_id', 'left')
->where('t_production_article_author_to_organ.p_article_author_id', $v['p_article_author_id'])
->where('t_production_article_author_to_organ.state', 0)
->select();
foreach ($cac as $val) {
if (!in_array($val['organ_name'], $address)) {
$address[] = $val['organ_name'];
}
}
// foreach ($authors as $v) {
// $cac = $this->production_article_author_to_organ_obj
// ->field('t_production_article_organ.*')
// ->join('t_production_article_organ', 't_production_article_organ.p_article_organ_id = t_production_article_author_to_organ.p_article_organ_id', 'left')
// ->where('t_production_article_author_to_organ.p_article_author_id', $v['p_article_author_id'])
// ->where('t_production_article_author_to_organ.state', 0)
// ->select();
// foreach ($cac as $val) {
// if (!in_array($val['organ_name'], $address)) {
// $address[] = $val['organ_name'];
// }
// }
// }
$os = $this->production_article_author_to_organ_obj->where('p_article_id',$p_article_id)->where('state',0)->column('p_article_organ_id');
$ors = $this->production_article_organ_obj->where('p_article_organ_id','in',$os)->select();
foreach($ors as $v){
$address[] = $v['organ_name'];
}
$first_num = 0; //第一作者的总数
@@ -1545,6 +1550,7 @@ class Production extends Controller
->join('t_production_article_organ', 't_production_article_organ.p_article_organ_id = t_production_article_author_to_organ.p_article_organ_id', 'left')
->where('t_production_article_author_to_organ.p_article_author_id', $v['p_article_author_id'])
->where('t_production_article_author_to_organ.state', 0)
->order('t_production_article_author_to_organ.p_article_organ_id')
->select();
foreach ($cac as $val) {
$cache_str .= (intval(search_array_val($address, $val['organ_name'])) + 1) . ", ";

View File

@@ -20,6 +20,8 @@ class Ucenter extends Controller{
protected $major_obj = "";
protected $major_to_journal_obj = '';
protected $user_cv_obj = '';
protected $apply_board_obj = '';
protected $apply_yboard_obj = '';
public function __construct(\think\Request $request = null)
{
@@ -35,6 +37,8 @@ class Ucenter extends Controller{
$this->major_obj = Db::name("major");
$this->major_to_journal_obj = Db::name('major_to_journal');
$this->user_cv_obj = Db::name('user_cv');
$this->apply_board_obj = Db::name('apply_board');
$this->apply_yboard_obj = Db::name('apply_yboard');
}
@@ -95,6 +99,75 @@ class Ucenter extends Controller{
return jsonSuccess($userInfo);
}
public function getCanApplyJournal(){
$data = $this->request->post();
$rule = new Validate([
'user_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$journals = $this->apply_board_obj->where('user_id',$data['user_id'])->where('state',0)->column("journal_id");
$js = $this->board_to_journal_obj->where('user_id',$data['user_id'])->where('state',0)->column('journal_id');
$list = $this->journal_obj->where('journal_id','not in',$journals)->where('journal_id','not in',$js)->where('state',0)->select();
$re['journals'] = $list;
return jsonSuccess($re);
}
public function getCanApplyYjournal(){
$data = $this->request->post();
$rule = new Validate([
'user_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$ids = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->where('state',0)->where('is_yboard',0)->column('journal_id');
$journals = $this->journal_obj->where('journal_id','in',$ids)->where('state',0)->select();
$re['journals'] = $journals;
return jsonSuccess($re);
}
public function applyYboard(){
$data = $this->request->post();
$rule = new Validate([
'user_id'=>'require',
'journal_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$check = $this->apply_yboard_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
if($check){
return jsonError("Your application for Editorial Board is processing. Please do not repeat it.");
}
$insert['user_id'] = $data['user_id'];
$insert['journal_id'] = $data['journal_id'];
$insert['ctime'] = time();
$this->apply_yboard_obj->insert($insert);
return jsonSuccess([]);
}
public function applyBoard(){
$data = $this->request->post();
$rule = new Validate([
'user_id'=>'require',
'journal_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$check = $this->apply_board_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
if($check){
return jsonError("");
}
$insert['user_id'] = $data['user_id'];
$insert['journal_id'] = $data['journal_id'];
$insert['ctime'] = time();
$this->apply_board_obj->insert($insert);
return jsonSuccess([]);
}
/**
* 增加用户cv
*/

View File

@@ -36,6 +36,8 @@ class User extends Controller
protected $user_to_special_obj = '';
protected $user_register_check_obj = '';
protected $user_cert_obj = '';
protected $apply_board_obj = '';
protected $apply_yboard_obj = '';
public function __construct(\think\Request $request = null)
{
@@ -58,6 +60,8 @@ class User extends Controller
$this->user_to_special_obj = Db::name('user_to_special');
$this->user_register_check_obj = Db::name('user_register_check');
$this->user_cert_obj = Db::name('user_cert');
$this->apply_board_obj = Db::name('apply_board');
$this->apply_yboard_obj = Db::name('apply_yboard');
}
public function pstest(){
@@ -125,6 +129,22 @@ class User extends Controller
}
}
/**
* 用户评价
*/
public function userScore(){
$data = $this->request->post();
$rule = new Validate([
'user_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$user_info = $this->user_obj->where('user_id',$data['user_id'])->find();
}
/**
* 为所有用户发送邮件
*/
@@ -302,6 +322,66 @@ class User extends Controller
return jsonSuccess($re);
}
public function getBoardApplys(){
$data = $this->request->post();
$rules = new Validate([
'editor_id' => 'require'
]);
if (!$rules->check($data)) {
return jsonError($rules->getError());
}
$ids = $this->journal_obj->where('editor_id',$data['editor_id'])->column('journal_id');
$list = $this->apply_board_obj
->field("t_journal.title,t_apply_board.*,t_user.account,t_user.email,t_user.realname")
->join("t_journal",'t_journal.journal_id = t_apply_board.journal_id','left')
->join("t_user","t_user.user_id = t_apply_board.user_id",'left')
->where('t_apply_board.journal_id','in',$ids)->where('t_apply_board.state',0)->select();
$re['applys'] = $list;
return jsonSuccess($re);
}
public function delBoardApply(){
$data = $this->request->post();
$rules = new Validate([
'ap_board_id' => 'require'
]);
if (!$rules->check($data)) {
return jsonError($rules->getError());
}
$this->apply_board_obj->where('ap_board_id',$data['ap_board_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
public function getYboardApplys(){
$data = $this->request->post();
$rules = new Validate([
'editor_id' => 'require'
]);
if (!$rules->check($data)) {
return jsonError($rules->getError());
}
$ids = $this->journal_obj->where('editor_id',$data['editor_id'])->column('journal_id');
$list = $this->apply_yboard_obj
->field("t_journal.title,t_apply_yboard.*,t_user.account,t_user.email,t_user.realname")
->join("t_journal",'t_journal.journal_id = t_apply_yboard.journal_id','left')
->join("t_user","t_user.user_id = t_apply_yboard.user_id",'left')
->where('t_apply_yboard.journal_id','in',$ids)->where('t_apply_yboard.state',0)->select();
$re['applys'] = $list;
return jsonSuccess($re);
}
public function delYboardApply(){
$data = $this->request->post();
$rules = new Validate([
'ap_yboard_id' => 'require'
]);
if (!$rules->check($data)) {
return jsonError($rules->getError());
}
$this->apply_yboard_obj->where('ap_yboard_id',$data['ap_yboard_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
/**
* 添加用户
*/