12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkAdmin
- // +----------------------------------------------------------------------
- // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
- // +----------------------------------------------------------------------
- // | 官方网站: http://demo.thinkadmin.top
- // +----------------------------------------------------------------------
- // | 开源协议 ( https://mit-license.org )
- // +----------------------------------------------------------------------
- // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
- // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
- // +----------------------------------------------------------------------
- namespace app\approve\controller;
- use app\common\constant\CommonConstant;
- use app\common\constant\OfferConstant;
- use app\common\service\CommonService;
- use app\common\service\UserService;
- use app\common\model\ApproveInfo as model;
- use library\Controller;
- /**
- * 审批申请
- */
- class ApproveInfo extends Controller
- {
- /**
- * 绑定数据表
- * @var string
- */
- protected $table = 'ApproveInfo';
- /**
- * 控制器初始化
- */
- protected function initialize()
- {
- $this->get_module_list = CommonConstant::get_module_list();
- $this->get_approve_status_list = CommonConstant::get_approve_status_list();
- $this->get_degree_list = OfferConstant::get_degree_list();
- }
- /**
- * 列表
- * @auth true
- * @menu true
- * @throws \think\Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function index()
- {
- $this->module = input('module');
- $this->title = $this->get_module_list[$this->module].'列表';
- $this->get_type_list = CommonService::get_type_list($this->module);
- $this->limit = input('limit');
- // 分页每页显示记录数
- $limit = intval($this->request->get('limit', cookie('page-limit')));
- cookie('page-limit', $limit = $limit >= 10 ? $limit : 20);
- if ($this->limit > 0) $limit = $this->limit;
- $data = model::field('is_deleted',true)
- ->where('module',$this->module)
- ->where('is_deleted',CommonConstant::IS_DELETED_0)
- ->with([
- 'approveInfoUser' => function ($query) {
- $query->field('userid,name,mobile');
- },
- ])
- ->order('id desc')
- ->paginate($limit)
- ->toArray();
- $list = $data['data'];
- $result = ['page' => ['limit' => intval($limit), 'total' => intval($data['total']), 'pages' => intval($data['last_page']), 'current' => intval($data['current_page'])], 'list' => $list];
- return $this->fetch('', $result);
- }
- }
|