diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 0df67b1..bc7e9be 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -68,4 +68,19 @@ class Common extends ApiController $subject = Db::name('InvoiceSubject')->where(['status' => 1])->order('id desc')->select()->toArray(); $this->apiSuccess('获取成功', $subject); } + + //获取待办事项 + public function get_todo_subject() + { + $this->uid = JWT_UID; + $subject = [ + 'approve'=>Db::name('Approve')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")]])->count(), + 'expenses'=>Db::name('Expense')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count(), + 'invoice'=>Db::name('Invoice')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count(), + 'income'=>Db::name('Invoice')->where([['is_cash', '<', 2],['admin_id','=',$this->uid],['check_status', '=', 5],['delete_time', '=', 0]])->count(), + 'contract'=>Db::name('Contract')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count(), + 'task'=>$handle['task'] = Db::name('ProjectTask')->where([['director_uid', '=', $this->uid],['flow_status', '<', 3],['delete_time', '=', 0]])->count() + ]; + $this->apiSuccess('获取成功', $subject); + } }