| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?php
- class EduUserInvestorAction extends CommonAction
- {
- public function index()
- {
- $map = array();
- if (intval($_REQUEST['id']) > 0) {
- $map[DB_PREFIX . 'user.id'] .= intval($_REQUEST['id']);
- }
- if (trim($_REQUEST['nick_name']) != '') {
- $map[DB_PREFIX . 'user.nick_name'] = array('like', '%' . trim($_REQUEST['nick_name']) . '%');
- }
- if (trim($_REQUEST['contact']) != '') {
- $map[DB_PREFIX . 'user.contact'] = array('like', '%' . trim($_REQUEST['contact']) . '%');
- }
- if (trim($_REQUEST['mobile']) != '') {
- $map[DB_PREFIX . 'user.mobile'] = array('like', '%' . trim($_REQUEST['mobile']) . '%');
- }
- $map[DB_PREFIX . 'user.is_authentication'] = 1;
- $map[DB_PREFIX . 'user.is_effect'] = 1;
- $map[DB_PREFIX . 'user.user_type'] = 0;
- if (method_exists($this, '_filter')) {
- $this->_filter($map);
- }
- //$name=$this->getActionName();
- $model = D('User');
- if (!empty ($model)) {
- $this->_list($model, $map);
- }
- $this->display();
- }
- public function show_content()
- {
- $id = intval($_REQUEST['id']);
- $status = intval($_REQUEST['status']);
- $user = M("user")->getById($id);
- $user['do_info'] = '审核通过';
- $user['is_investor_name'] = get_investor($user['user_type']);
- $user['investor_status_name'] = get_investor_status($user['is_authentication']);
- $user['identify_hold_image'] = get_spec_image($user['identify_hold_image']);
- $user['identify_positive_image'] = get_spec_image($user['identify_positive_image']);
- $user['identify_nagative_image'] = get_spec_image($user['identify_nagative_image']);
- if ($user['authentication_type'] == '教师') {
- $teacher = M('EduTeacher')->where(array('user_id' => $user['id']))->find();
- $user['teaching_certificate'] = get_spec_image($teacher['teaching_certificate']);
- $user['education_certificate'] = get_spec_image($teacher['education_certificate']);
- } elseif ($user['authentication_type'] == '机构') {
- $org = M('EduOrg')->where(array('user_id' => $user['id']))->find();
- $user['business_license'] = get_spec_image($org['business_license']);
- }
- $data['order_type'] = 'shop';
- $data['order_status'] = 4;
- $data['viewer_id'] = $id;
- // if(define(DISTRIBUTION_MODULE) && DISTRIBUTION_MODULE == 1){
- // $order = M('goods_order')->where($data)->count('id');
- // $user['order'] = intval($order);
- // }
- $this->assign('user', $user);
- $this->assign('status', $status);
- $this->display();
- }
- public function investor_go_allow()
- {
- $id = intval($_REQUEST['id']);
- $status = intval($_REQUEST['is_authentication']);
- $v_explain = strim($_REQUEST['v_explain']);
- if ($_REQUEST['investor_send_info']) {
- $investor_send_info = strim($_REQUEST['investor_send_info']);
- }
- fanwe_require(APP_ROOT_PATH . 'mapi/lib/redis/BaseRedisService.php');
- fanwe_require(APP_ROOT_PATH . 'mapi/lib/redis/UserRedisService.php');
- $user_redis = new UserRedisService();
- $user = M("User")->getById($id);
- if ($user) {
- //$user_data['id'] = $user['id'];
- $user_data['is_authentication'] = $status;
- if ($status == 3) {
- $user_data['v_explain'] = '';
- $user_data['v_icon'] = '';
- } else {
- $user_data['v_explain'] = $v_explain;
- if ($user_data['v_explain'] == '') {
- $user_data['v_explain'] = $user['authentication_type'];
- }
- $user_data['v_icon'] = get_spec_image(M('AuthentList')->where("name='" . trim($user['authentication_type'] . "'"))->getField("icon"));
- }
- //认证ID
- $user_data['authent_list_id'] = get_spec_image(M('AuthentList')->where("name='" . trim($user['authentication_type'] . "'"))->getField("id"));
- if ($investor_send_info) {
- $user_data['investor_send_info'] = $investor_send_info;
- } else {
- $user_data['investor_send_info'] = '';
- }
- $where = "id=" . intval($user['id']);
- if ($GLOBALS['db']->autoExecute(DB_PREFIX . "user", $user_data, 'UPDATE', $where)) {
- $is_effect = $status == 2 ? 1 : 0;
- if ($user['authentication_type'] == '教师') {
- $GLOBALS['db']->autoExecute(DB_PREFIX . 'edu_teacher', array('is_effect' => $is_effect), 'UPDATE',
- 'user_id=' . $id);
- } elseif ($user['authentication_type'] == '机构') {
- $GLOBALS['db']->autoExecute(DB_PREFIX . 'edu_org', array('is_effect' => $is_effect), 'UPDATE',
- 'user_id=' . $id);
- }
- save_log($user['id'] . "审核操作成功", 1);
- } else {
- save_log($user['id'] . "审核操作失败", 0);
- }
- //redis化
- $user_redis->update_db($user['id'], $user_data);
- //send_investor_status($user_data);
- $this->success("操作成功");
- } else {
- $this->error("没有该会员信息");
- }
- }
- }
- ?>
|