|
@@ -1,122 +0,0 @@
|
|
|
-<?php
|
|
|
-namespace app\leave\controller;
|
|
|
-use app\common\model\User;
|
|
|
-use library\Controller;
|
|
|
-use think\Db;
|
|
|
-/**
|
|
|
- * 请假流程
|
|
|
- * Class Flow
|
|
|
- * @package app\leave\controller
|
|
|
- */
|
|
|
-class Flow extends Controller
|
|
|
-{
|
|
|
- /**
|
|
|
- * 绑定数据表
|
|
|
- * @var string
|
|
|
- */
|
|
|
- protected $table = 'LeaveFlow';
|
|
|
-
|
|
|
- /**
|
|
|
- * 流程列表
|
|
|
- * @auth true
|
|
|
- * @menu true
|
|
|
- * @throws \think\Exception
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- * @throws \think\exception\PDOException
|
|
|
- */
|
|
|
- public function index()
|
|
|
- {
|
|
|
- $this->title = '管理';
|
|
|
- $sel_type = input('sel_type');
|
|
|
- $query = $this->_query($this->table)
|
|
|
- ->alias('f')
|
|
|
- ->field('f.*,u.name,u.headimg')
|
|
|
- ->leftJoin('store_member u','u.id = f.user_id')
|
|
|
- ->order('sort asc,id desc')
|
|
|
- ->where('is_deleted',0)
|
|
|
- ->when($sel_type,function ($query)use ($sel_type){
|
|
|
- if($sel_type) $query->where('type',$sel_type);
|
|
|
- })->page(false);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 数据列表处理
|
|
|
- * @auth true
|
|
|
- * @menu true
|
|
|
- * @param array $data
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- */
|
|
|
- protected function _index_page_filter(&$data)
|
|
|
- {
|
|
|
- foreach ($data as $k=>&$v){
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- * @auth true
|
|
|
- * @menu true
|
|
|
- * @param array $data
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- */
|
|
|
- public function remove()
|
|
|
- {
|
|
|
- $this->_delete($this->table);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加
|
|
|
- * @auth true
|
|
|
- * @menu true
|
|
|
- * @param array $data
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- */
|
|
|
- public function add(){
|
|
|
- $this->title = '添加';
|
|
|
- $this->_form($this->table, 'form');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- *
|
|
|
- * 编辑
|
|
|
- * @auth true
|
|
|
- * @menu true
|
|
|
- * @param array $data
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- */
|
|
|
- public function edit()
|
|
|
- {
|
|
|
- $this->title = '编辑';
|
|
|
- $this->_form($this->table, 'form');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- *
|
|
|
- * 数据处理
|
|
|
- * @auth true
|
|
|
- * @menu true
|
|
|
- * @param array $data
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- */
|
|
|
- protected function _form_filter(&$data)
|
|
|
- {
|
|
|
- if($this->request->isGet()) {
|
|
|
- $this->all_user = User::where('is_deleted',0)->column('name','id');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|