chengkun
2025-04-30 6ab292fb7415be124651e312ec4f21c594568f17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
 
class info_controller extends user_controller{
    
    /*wxapp基本信息页面显示、创建简历页面显示*/
    function getinfo_action()
    {
        $resumeM    =    $this->MODEL('resume');
        $resume        =    $resumeM -> getResumeInfo(array('uid'=>$this->member['uid']),array('logo'=>1,'setname'=>1));
 
        $data        =    count($resume) ? $resume : array();
        $data['resumename'] = !empty($this->config['sy_resumename_num']) ? $this->config['sy_resumename_num'] : 0;
        $this->render_json(0,'',$data);
    }
    /*wxapp保存基本信息*/
    function saveinfo_action()
    {
        $resumeM      =      $this -> MODEL('resume'); 
 
        $resume     =     $resumeM->getResumeInfo(array('uid'=>$this->member['uid']));
 
        $mData    =    array(
            'mobile'        =>    $_POST['telphone'],
            'email'            =>    $_POST['email'],
        );
        $rData    =    array(
            'name'            =>    $_POST['name'],
            'sex'            =>    $_POST['sex'],
            'birthday'        =>    $_POST['birthday'],
            'edu'            =>    $_POST['edu'],
            'exp'            =>    $_POST['exp'],
            'telphone'        =>    $_POST['telphone'],
            'marriage'        =>    $_POST['marriage'],
            'height'        =>    $_POST['height'],
            'weight'        =>    $_POST['weight'],
            'nationality'    =>    $_POST['nationality'],
            'domicile'        =>    $_POST['domicile'],
            'address'        =>    $_POST['address'],
            'homepage'        =>    $_POST['homepage'],
            'living'        =>    $_POST['living'],
            'email'            =>    $_POST['email'],
            'phototype'     =>  $_POST['phototype'],
            'nametype'      =>  $_POST['nametype'],
            'wxid'            =>    $_POST['wxid'],
            'ewmFromWx'     =>     $_FILES['photos'],//二维码
            'lastupdate'    =>  time()
        );
        if($this -> config['user_revise_state'] == '0'){
            $rData['state'] = 0 ;
        }
        if(!$resume['photo'] || ($resume['defphoto']==2 && $rData['sex']!=$resume['sex'])){
            $logo = $resumeM->deflogo($rData);
            if($logo!=''){
                $rData['photo']         = $logo;
                $rData['defphoto']         = 2;
                $rData['photo_status']     = 1;
            }
            
        }
        if($this->member['usertype'] == 0){
            $userinfoM    =   $this->MODEL("userinfo");
            $userinfoM -> activUser($this->member['uid'],1);
        }
        $resumeM  =  $this->MODEL('resume');
        if (isset($_POST['provider'])) {
 
            if ($_POST['provider'] == 'wap') {
 
                $port           =   2;
            } elseif ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'toutiao' || $_POST['provider'] == 'weixin') {
 
                $port           =   3;
            } elseif ($_POST['provider'] == 'app') {
 
                $port           =   4;
            }
        }
        $return   =  $resumeM -> upResumeInfo(array('uid'=>$this->member['uid']),array('mData'=>$mData,'rData'=>$rData,'utype'=>'user','source'=>$_POST['source'], 'port' => $port));
        $data['error']    =    $return['errcode']==9 ? 1 : 2;
        $this -> render_json($data['error'],$return['msg'],'');
    }
    /*wxapp保存头像*/
    function savephoto_action()
    {
        
        $resumeM          =    $this        -> MODEL('resume');
 
 
        $upData = array('utype'=>'user','photo'=>'','source'=>$_POST['source'],'preview'=>1);
        if (!empty($_POST['source']) && $_POST['source'] == 'wap'){
            $upData['base'] = $_POST['uimage'];
        }else{
            $upData['photo'] = $_FILES['photos'];
        }
 
        $return           =   $resumeM    -> upPhoto(array('uid'=>$this->member['uid']), $upData);
 
        $data['error']    =    $return['errcode']==9    ?    1    :    2;
        
        $this -> render_json($data['error'],$return['msg'],$return['picurl']);
 
    }
    
}