123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?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');
- }
- }
- }
|