123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?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\ApplyConstant;
- use app\common\constant\CommonConstant;
- use app\common\constant\OfferConstant;
- use app\common\model\ApproveInfoLog as model;
- use app\common\service\CommonService;
- use library\Controller;
- /**
- * 审批申请-审批人修改记录
- */
- class ApproveInfoLog extends Controller
- {
- /**
- * 绑定数据表
- * @var string
- */
- protected $table = 'ApproveInfoLog';
- /**
- * 控制器初始化
- */
- protected function initialize()
- {
- $this->get_module_list = CommonConstant::get_module_list();
- $this->get_approve_status_list = CommonConstant::get_approve_status_list();
- $this->get_approve_status_list_admin = CommonConstant::get_approve_status_list_admin();
- $this->get_is_who_list = CommonConstant::get_is_who_list();
- $this->get_pay_type_list = ApplyConstant::get_pay_type_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->info_id = $info_id = input('info_id') ?: 0;
- $this->title = '审批人修改记录';
- $data = model::field('before,after', true)
- ->where('info_id',$info_id)
- ->with([
- 'user'=>function($query){
- $query->field('id,userid,name,mobile');
- }
- ])
- ->order('id desc');
- self::_init($data);
- }
- /**
- * 编辑
- * @auth true
- * @throws \think\Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- * @throws \think\exception\PDOException
- */
- public function edit()
- {
- $this->title = '审批人修改记录详情';
- $data = model::find(input('id') ?:0);
- if($data){
- $data = $data->toArray();
- $data['before_text']['module_info']['document_text'] = isset($data['before_text']['module_info']['document']) ? json_decode($data['before_text']['module_info']['document'],true) : [];
- $data['before_text']['module_info']['images_text'] = isset($data['before_text']['module_info']['images']) ? json_decode($data['before_text']['module_info']['images'],true) : [];
- $data['after_text']['module_info']['document_text'] = isset($data['after_text']['module_info']['document']) ? json_decode($data['after_text']['module_info']['document'],true) : [];
- $data['after_text']['module_info']['images_text'] = isset($data['after_text']['module_info']['images']) ? json_decode($data['after_text']['module_info']['images'],true) : [];
- $this->title = '审批人修改记录详情-'.$this->get_module_list[$data['module']];
- $this->get_type_list = CommonService::get_type_list($data['module']);
- }
- return $this->fetch('form', ['vo' => $data['before_text'],'vo2'=>$data['after_text']]);
- }
- }
|