| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace app\user\controller;
- use think\Validate;
- use think\Lang;
- class Member extends UserControl
- {
- public function _initialize()
- {
- parent::_initialize();
- Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/member.lang.php');
- }
- /**
- * 用户
- * @return mixed
- */
- public function index()
- {
- $user_info = $this->getAdminInfo();
- if (request()->isPost()) {
- $user_name = input('post.user_name');
- $company = input('post.company');
- $trade = input('post.trade');
- $address = input('post.address');
- $update_info = array(
- 'user_name' => $user_name,
- 'company' => $company,
- 'trade' => $trade,
- 'address' => $address
- );
- //print_r($update_info);
- $res = db('user')->where('user_id', $user_info['user_id'])->update($update_info);
- if($res == 1){
- $this->success('用户信息修改成功');
- }else{
- $this->success('用户信息修改失败');
- }
- //return $this->redirect('User/Member/index');
- }else{
- $user = db('user')->where('user_email',$user_info['user_email'])->find();
- if($user['user_status'] ==1){
- $user['user_status'] = '已实名认证';
- }
- if($user['user_status'] ==-1){
- $user['user_status'] = '未实名认证';
- }
- if($user['user_status'] ==2){
- $user['user_status'] = '实名认证中';
- }
- if($user['user_status'] ==3){
- $user['user_status'] = '实名认证失败';
- }
- if($user['user_type'] ==1){
- $user['user_type'] = '个人用户';
- }
- if($user['user_type'] ==2){
- $user['user_type'] = '企业用户';
- }
- $this->assign('user', $user);
- return $this->fetch();
- }
- }
- }
|