From 04aef584a32ac7b6b63e4fdbcae186e05e06b88a Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Fri, 26 Feb 2021 10:44:22 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Article.php | 2 +- application/api/controller/Auto.php | 1 + application/api/controller/Staff.php | 197 +++++++++++++++++++++++++ application/common.php | 8 + 4 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 application/api/controller/Staff.php diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 9e42e16..99c03e8 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -525,7 +525,7 @@ class Article extends Controller { $tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',
'; $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
'; $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript. I am writing just to follow up on the suggestion from the editor of Traditional Medicine Research that you might be interested in submitting your paper to '.$trans_journal['title'].' instead.

'; - $tt .= 'If you choose to pursue publication in '.$trans_journal['title'].', please submit your manuscript to ('.$trans_journal['website'].').'; + $tt .= 'If you choose to pursue publication in '.$trans_journal['title'].', please click the folowing link to comfirm ('.$trans_journal['website'].').'; $tt .= '

Yours sincerely,

'; $tt .= 'Sincerely,
Editorial Office
'; } diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php index afc12e9..3b5937e 100644 --- a/application/api/controller/Auto.php +++ b/application/api/controller/Auto.php @@ -61,6 +61,7 @@ class Auto extends Controller { * 处理过期审稿 */ public function overdue_reviewer() { + die('Temporarily Out of Service'); $where['state'] = 0; $where['ctime'] = ['lt', time() - 3600 * 24 * 14]; $revs = $this->article_reviewer_obj->where($where)->select(); diff --git a/application/api/controller/Staff.php b/application/api/controller/Staff.php new file mode 100644 index 0000000..d5dd783 --- /dev/null +++ b/application/api/controller/Staff.php @@ -0,0 +1,197 @@ +user_obj = Db::name('user'); + $this->user_act_obj = Db::name('user_act'); + $this->article_obj = Db::name('article'); + $this->journal_obj = Db::name('journal'); + $this->user_log_obj = Db::name('user_log'); + $this->reviewer_major_obj = Db::name('reviewer_major'); + $this->reviewer_to_journal_obj = Db::name('reviewer_to_journal'); + $this->article_msg_obj = Db::name('article_msg'); + $this->article_file_obj = Db::name('article_file'); + $this->article_reviewer_obj = Db::name('article_reviewer'); + $this->article_author_obj = Db::name('article_author'); + $this->article_transfer_obj = Db::name('article_transfer'); + $this->staff_obj = Db::name('staff'); + $this->staff_level_obj = Db::name('staff_level'); + $this->staff_log_obj = Db::name('staff_log'); + $this->staff_to_journal_obj = Db::name('staff_to_journal'); + } + + /** + * 添加工资level + */ + public function addStaffLevel(){ + $data = $this->request->post(); + $insert['title'] = $data['title']; + $insert['wages'] = $data['wages']; + $this->staff_level_obj->insert($insert); + return jsonSuccess([]); + } + + /** + * 删除工资level + */ + public function delStaffLevel(){ + $data = $this->request->post(); + $this->staff_level_obj->where('staff_level_id',$data['staff_level_id'])->update(['state'=>1]); + return jsonSuccess([]); + } + + /** + * 编辑工资level + */ + public function editStaffLevel(){ + $data = $this->request->post(); + $update['title'] = $data['title']; + $update['wages'] = $data['wages']; + $this->staff_level_obj->where('staff_level_id',$data['staff_level_id'])->update($update); + return jsonSuccess([]); + } + + /** + * 获取工资levels + */ + public function getStaffLevels(){ + $list = $this->staff_level_obj->where('state',0)->select(); + + $re['levels'] = $list; + + return jsonSuccess($re); + } + + /** + * 添加员工 + */ + public function addStaff(){ + $data = $this->request->post(); + $insert['staff_level_id'] = $data['staff_level_id']; + $insert['name'] = $data['name']; + $insert['phone'] = $data['phone']; + $insert['email'] = $data['email']; + $insert['password'] = md5($data['password']); + $insert['addition'] = $data['addition']; + $insert['addition_reason'] = $data['addition_reason']; + $insert['subtraction'] = $data['subtraction']; + $insert['subtraction_reason'] = $data['subtraction_reason']; + $this->staff_obj->insert($insert); + return jsonSuccess([]); + } + + /** + * 删除员工 + */ + public function delStaff() { + $data = $this->request->post(); + $this->staff_obj->where('staff_id',$data['staff_id'])->update(['state'=>1]); + return jsonSuccess([]); + } + + /** + * 更新员工信息 + */ + public function editStaff() { + $data = $this->request->post(); + $update['staff_level_id'] = $data['staff_level_id']; + $update['name'] = $data['name']; + $update['phone'] = $data['phone']; + $update['email'] = $data['email']; + $update['password'] = md5($data['password']); + $update['addition'] = $data['addition']; + $update['addition_reason'] = $data['addition_reason']; + $update['subtraction'] = $data['subtraction']; + $update['subtraction_reason'] = $data['subtraction_reason']; + $this->staff_obj->where('staff_id',$data['staff_id'])->update($update); + return jsonSuccess([]); + } + + /** + * 获取员工列表 + */ + public function getStaffs(){ + $data = $this->request->post(); + $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; + $list = $this->staff_obj->where('state',0)->limit($limit_start,$data['pageSize'])->select(); + $count = $this->staff_obj->where('state',0)->count(); + $re['staffs'] = $list; + $re['count'] = $count; + return jsonSuccess($re); + } + + /** + * 获取员工实时工资 + */ + public function getStaffRealtime(){ + $data = $this->request->post(); + + + } + + /** + * 核算月薪(系统自动调用) + */ + public function pushStaffLog(){ + + } + + /** + * 获取员工工资信息(管理员专用) + */ + public function getAllStaff($month = '0'){ + if($month=='0'){//获取当月实时工资 + + }else{//获取其他月份工资log + + } + } + + /** + * 获取用户某月份工资 + */ + public function getStaffLog($month){ + + } + + /** + * 获取员工工资查询 + */ + public function checkStaffLogin(){ + $data = $this->request->post(); + $where['name'] = $data['name']; + $where['password'] = md5($data['password']); + $where['state'] = 0; + $res = $this->staff_obj->where($where)->find(); + if($res){ + return jsonSuccess([]); + }else{ + return jsonError('check error'); + } + } + + +} diff --git a/application/common.php b/application/common.php index 4aa208b..8fe288e 100644 --- a/application/common.php +++ b/application/common.php @@ -132,3 +132,11 @@ function add_usermsg($userid, $content, $url) { $msgdata['ctime'] = time(); return $msg_obj->insert($msgdata); } + +function jsonSuccess($data){ + return json(['code'=>0,'msg'=>'success','data'=>$data]); +} + +function jsonError($msg){ + return json(['code'=>1,'msg'=>$msg]); +} \ No newline at end of file