EduUserInvestorAction.class.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. class EduUserInvestorAction extends CommonAction
  3. {
  4. public function index()
  5. {
  6. $map = array();
  7. if (intval($_REQUEST['id']) > 0) {
  8. $map[DB_PREFIX . 'user.id'] .= intval($_REQUEST['id']);
  9. }
  10. if (trim($_REQUEST['nick_name']) != '') {
  11. $map[DB_PREFIX . 'user.nick_name'] = array('like', '%' . trim($_REQUEST['nick_name']) . '%');
  12. }
  13. if (trim($_REQUEST['contact']) != '') {
  14. $map[DB_PREFIX . 'user.contact'] = array('like', '%' . trim($_REQUEST['contact']) . '%');
  15. }
  16. if (trim($_REQUEST['mobile']) != '') {
  17. $map[DB_PREFIX . 'user.mobile'] = array('like', '%' . trim($_REQUEST['mobile']) . '%');
  18. }
  19. $map[DB_PREFIX . 'user.is_authentication'] = 1;
  20. $map[DB_PREFIX . 'user.is_effect'] = 1;
  21. $map[DB_PREFIX . 'user.user_type'] = 0;
  22. if (method_exists($this, '_filter')) {
  23. $this->_filter($map);
  24. }
  25. //$name=$this->getActionName();
  26. $model = D('User');
  27. if (!empty ($model)) {
  28. $this->_list($model, $map);
  29. }
  30. $this->display();
  31. }
  32. public function show_content()
  33. {
  34. $id = intval($_REQUEST['id']);
  35. $status = intval($_REQUEST['status']);
  36. $user = M("user")->getById($id);
  37. $user['do_info'] = '审核通过';
  38. $user['is_investor_name'] = get_investor($user['user_type']);
  39. $user['investor_status_name'] = get_investor_status($user['is_authentication']);
  40. $user['identify_hold_image'] = get_spec_image($user['identify_hold_image']);
  41. $user['identify_positive_image'] = get_spec_image($user['identify_positive_image']);
  42. $user['identify_nagative_image'] = get_spec_image($user['identify_nagative_image']);
  43. if ($user['authentication_type'] == '教师') {
  44. $teacher = M('EduTeacher')->where(array('user_id' => $user['id']))->find();
  45. $user['teaching_certificate'] = get_spec_image($teacher['teaching_certificate']);
  46. $user['education_certificate'] = get_spec_image($teacher['education_certificate']);
  47. } elseif ($user['authentication_type'] == '机构') {
  48. $org = M('EduOrg')->where(array('user_id' => $user['id']))->find();
  49. $user['business_license'] = get_spec_image($org['business_license']);
  50. }
  51. $data['order_type'] = 'shop';
  52. $data['order_status'] = 4;
  53. $data['viewer_id'] = $id;
  54. // if(define(DISTRIBUTION_MODULE) && DISTRIBUTION_MODULE == 1){
  55. // $order = M('goods_order')->where($data)->count('id');
  56. // $user['order'] = intval($order);
  57. // }
  58. $this->assign('user', $user);
  59. $this->assign('status', $status);
  60. $this->display();
  61. }
  62. public function investor_go_allow()
  63. {
  64. $id = intval($_REQUEST['id']);
  65. $status = intval($_REQUEST['is_authentication']);
  66. $v_explain = strim($_REQUEST['v_explain']);
  67. if ($_REQUEST['investor_send_info']) {
  68. $investor_send_info = strim($_REQUEST['investor_send_info']);
  69. }
  70. fanwe_require(APP_ROOT_PATH . 'mapi/lib/redis/BaseRedisService.php');
  71. fanwe_require(APP_ROOT_PATH . 'mapi/lib/redis/UserRedisService.php');
  72. $user_redis = new UserRedisService();
  73. $user = M("User")->getById($id);
  74. if ($user) {
  75. //$user_data['id'] = $user['id'];
  76. $user_data['is_authentication'] = $status;
  77. if ($status == 3) {
  78. $user_data['v_explain'] = '';
  79. $user_data['v_icon'] = '';
  80. } else {
  81. $user_data['v_explain'] = $v_explain;
  82. if ($user_data['v_explain'] == '') {
  83. $user_data['v_explain'] = $user['authentication_type'];
  84. }
  85. $user_data['v_icon'] = get_spec_image(M('AuthentList')->where("name='" . trim($user['authentication_type'] . "'"))->getField("icon"));
  86. }
  87. //认证ID
  88. $user_data['authent_list_id'] = get_spec_image(M('AuthentList')->where("name='" . trim($user['authentication_type'] . "'"))->getField("id"));
  89. if ($investor_send_info) {
  90. $user_data['investor_send_info'] = $investor_send_info;
  91. } else {
  92. $user_data['investor_send_info'] = '';
  93. }
  94. $where = "id=" . intval($user['id']);
  95. if ($GLOBALS['db']->autoExecute(DB_PREFIX . "user", $user_data, 'UPDATE', $where)) {
  96. $is_effect = $status == 2 ? 1 : 0;
  97. if ($user['authentication_type'] == '教师') {
  98. $GLOBALS['db']->autoExecute(DB_PREFIX . 'edu_teacher', array('is_effect' => $is_effect), 'UPDATE',
  99. 'user_id=' . $id);
  100. } elseif ($user['authentication_type'] == '机构') {
  101. $GLOBALS['db']->autoExecute(DB_PREFIX . 'edu_org', array('is_effect' => $is_effect), 'UPDATE',
  102. 'user_id=' . $id);
  103. }
  104. save_log($user['id'] . "审核操作成功", 1);
  105. } else {
  106. save_log($user['id'] . "审核操作失败", 0);
  107. }
  108. //redis化
  109. $user_redis->update_db($user['id'], $user_data);
  110. //send_investor_status($user_data);
  111. $this->success("操作成功");
  112. } else {
  113. $this->error("没有该会员信息");
  114. }
  115. }
  116. }
  117. ?>