ApproveInfoLog.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://demo.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  12. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  13. // +----------------------------------------------------------------------
  14. namespace app\approve\controller;
  15. use app\common\constant\ApplyConstant;
  16. use app\common\constant\CommonConstant;
  17. use app\common\constant\OfferConstant;
  18. use app\common\model\ApproveInfoLog as model;
  19. use app\common\service\CommonService;
  20. use library\Controller;
  21. /**
  22. * 审批申请-审批人修改记录
  23. */
  24. class ApproveInfoLog extends Controller
  25. {
  26. /**
  27. * 绑定数据表
  28. * @var string
  29. */
  30. protected $table = 'ApproveInfoLog';
  31. /**
  32. * 控制器初始化
  33. */
  34. protected function initialize()
  35. {
  36. $this->get_module_list = CommonConstant::get_module_list();
  37. $this->get_approve_status_list = CommonConstant::get_approve_status_list();
  38. $this->get_approve_status_list_admin = CommonConstant::get_approve_status_list_admin();
  39. $this->get_is_who_list = CommonConstant::get_is_who_list();
  40. $this->get_pay_type_list = ApplyConstant::get_pay_type_list();
  41. $this->get_degree_list = OfferConstant::get_degree_list();
  42. }
  43. /**
  44. * 列表
  45. * @auth true
  46. * @menu true
  47. * @throws \think\Exception
  48. * @throws \think\db\exception\DataNotFoundException
  49. * @throws \think\db\exception\ModelNotFoundException
  50. * @throws \think\exception\DbException
  51. */
  52. public function index()
  53. {
  54. $this->info_id = $info_id = input('info_id') ?: 0;
  55. $this->title = '审批人修改记录';
  56. $data = model::field('before,after', true)
  57. ->where('info_id',$info_id)
  58. ->with([
  59. 'user'=>function($query){
  60. $query->field('id,userid,name,mobile');
  61. }
  62. ])
  63. ->order('id desc');
  64. self::_init($data);
  65. }
  66. /**
  67. * 编辑
  68. * @auth true
  69. * @throws \think\Exception
  70. * @throws \think\db\exception\DataNotFoundException
  71. * @throws \think\db\exception\ModelNotFoundException
  72. * @throws \think\exception\DbException
  73. * @throws \think\exception\PDOException
  74. */
  75. public function edit()
  76. {
  77. $this->title = '审批人修改记录详情';
  78. $data = model::find(input('id') ?:0);
  79. if($data){
  80. $data = $data->toArray();
  81. $data['before_text']['module_info']['document_text'] = isset($data['before_text']['module_info']['document']) ? json_decode($data['before_text']['module_info']['document'],true) : [];
  82. $data['before_text']['module_info']['images_text'] = isset($data['before_text']['module_info']['images']) ? json_decode($data['before_text']['module_info']['images'],true) : [];
  83. $data['after_text']['module_info']['document_text'] = isset($data['after_text']['module_info']['document']) ? json_decode($data['after_text']['module_info']['document'],true) : [];
  84. $data['after_text']['module_info']['images_text'] = isset($data['after_text']['module_info']['images']) ? json_decode($data['after_text']['module_info']['images'],true) : [];
  85. $this->title = '审批人修改记录详情-'.$this->get_module_list[$data['module']];
  86. $this->get_type_list = CommonService::get_type_list($data['module']);
  87. }
  88. return $this->fetch('form', ['vo' => $data['before_text'],'vo2'=>$data['after_text']]);
  89. }
  90. }