chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
 
class index_controller extends com_controller{
    // 企业会员中心首页
    function getIndex_action()
    {
        $info          =  $this->comInfo;
        $userinfoM  =  $this -> MODEL('userinfo');
        $jobM        =  $this -> MODEL('job');
        $couponM    =   $this->MODEL('coupon');
        $msgNumM       =  $this -> MODEL('msgNum');
        $orderM      =  $this -> MODEL('companyorder');
        $msg           =  $msgNumM -> getmsgNum($this->member['uid'],2,array('from' => 'wxapp'));
 
        $suid        =  $this->member['spid'] ? $this->member['spid'] : $this->member['uid'];
        $statis       =  $this->company_statis($suid);
 
        if ($this->config['com_enforce_info'] == 1) {
            if (empty($this->comInfo['name']) || empty($this->comInfo['address']) || empty($this->comInfo['pr'])) {
 
                if ($this->config['sy_user_change'] == 1) {
 
                    $return['remind'] = 2;
                } else {
 
                    $return['remind'] = 1;
                }
            }
        }
 
        if (empty($info['name'])){
            $info['name']   =  $this->member['username'];
        }
        
        $return['msg']         =  $msg;
        $return['info']        =  $info;
        $return['statis']      =  $statis;
        $date                =  date('Ymd');
        $reg                =  $userinfoM -> getMemberregInfo(array('uid'=>$this->member['uid'],'usertype'=>$this->member['usertype'],'date'=>$date));
        $signstate            =  $reg['id'] ? 1 : 0;
        $return['signstate']=  $signstate;
 
        
        $return['nofkorder']    =  $orderM    ->    getCompanyOrderNum(array('uid'=>$this->member['uid'],'usertype' =>$this->member['usertype'],'order_state'=>'1'));
        if($_POST['couponRest']){
            $return['couponnum']=  $couponM->getCouponNum(array('uid' =>$this->member['uid'], 'status' => 1,'validity' => array('>', time())));
        }
        
        
        $jobwhere['uid']        =   $this->member['uid'];
        $jobwhere['state']        =    1;
        $jobwhere['r_status']    =    1;
        $jobwhere['status']        =    0;
        $normal_job_num         =   $jobM -> getJobNum($jobwhere);;
        $return['jobnums']        =    $normal_job_num;
 
        $jobwhere['lastupdate'] =   array('<', strtotime('today'));
        $return['noRefreshNum'] =   $jobM -> getJobNum($jobwhere);
        
        $return['iosfk']        =    $this->config['sy_iospay'] ;
        $return['webtel']        =    !empty($this->config['sy_freewebtel']) ? $this->config['sy_freewebtel'] : '';
        $return['worktime']        =    !empty($this->config['sy_worktime']) ? $this->config['sy_worktime'] : '';
        // 客户服务
        $adminM                    =   $this -> MODEL('admin');
        $guweninfo              =   $adminM -> getAdminUser(array('uid' => $info['crm_uid']));
        $guweninfo['photo_n']     =  checkpic($guweninfo['photo'], $this->config['sy_guwen']);
        $guweninfo['ewm_n']       =  checkpic($guweninfo['ewm']);
        $guweninfo['freewebtel'] =  !empty($guweninfo['moblie']) ? $guweninfo['moblie'] : $this->config['sy_freewebtel'];
        $return['guweninfo']    =    $guweninfo ;
        
        include(CONFIG_PATH.'db.data.php');
        $spview_web   =   isset($arr_data['modelconfig']['spview']) && isset($this->config['sy_spview_web']) ? $this->config['sy_spview_web'] : 2;
        if ($this->platform == 'ios' && $_POST['provider'] == 'app'){
            // IOS APP 不支持视频面试
            $spview_web = 2;
        }
        $return['config']  =  array(
            'help'     =>  isset($this->config['sy_help_open']) ? $this->config['sy_help_open'] : 2,
            'part'     =>  isset($this->config['sy_part_web']) ? $this->config['sy_part_web'] : 2,
            'zph'      =>  isset($this->config['sy_zph_web']) ? $this->config['sy_zph_web'] : 2,
            'zphnet'   =>  isset($arr_data['modelconfig']['zphnet']) && isset($this->config['sy_zphnet_web']) ? $this->config['sy_zphnet_web'] : 2,
            'reward'   =>  isset($this->config['sy_reward_web']) ? $this->config['sy_reward_web'] : 2,
            'special'  =>  isset($this->config['sy_special_web']) ? $this->config['sy_special_web'] : 2,
            'spview'   =>  $spview_web
        );
        $return['qqdt']     =  !empty($this->config['sy_qqdt']) ? $this->config['sy_qqdt'] : 2;
        $return['wxlogin']  =  !empty($this->config['sy_app_wxlogin']) ? $this->config['sy_app_wxlogin'] : 2;
        $return['qqlogin']  =  !empty($this->config['sy_app_qqlogin']) ? $this->config['sy_app_qqlogin'] : 2;
 
        $WhbM       =   $this->MODEL('whb');
        $maxNum     =   $normal_job_num > 6 ? 6 : $normal_job_num;
        $syComHb    =   $WhbM->getWhbList(array('type' => 2, 'isopen' => 1, 'num' => $maxNum ));
        $return['hbNum']    =   count($syComHb);
        $return['ishb']     =  $this->config['sy_haibao_isopen'] == 1 ? true : false;
 
        $this->render_json(0, 'ok', $return);
    }
    //签到,TODO:会员中心
    function sign_action(){
        $IntegralM        =    $this -> MODEL('integral');
        $userinfoM        =    $this -> MODEL('userinfo');
        $date            =    date("Ymd");
        $member            =    $userinfoM -> getInfo(array('uid'=>$this->member['uid'],'usertype'=>$this->member['usertype']),array('field'=>"`signday`,`signdays`"));
        $lastreg        =    $userinfoM -> getMemberregInfo(array('uid'=>$this->member['uid'],'usertype'=>$this->member['usertype'],'orderby'=>'id,desc'));
        $lastregdate    =    date("Ymd",$lastreg['ctime']);
        if($lastregdate!=$date){
            $yesterday    =    date("Ymd",strtotime("-1 day"));
            if($lastregdate==$yesterday&&intval(date("d"))>1){
                if($member['signday']>=5){
                    $integral    =    $this->config['integral_signin']*2;
                }else{
                    $integral    =    $this->config['integral_signin'];
                }
                $signday    =    $member['signday']+1;
                $msg        =    '连续签到'.$signday."天";
            }else{
                $signday    =    '1';
                $integral    =    $this->config['integral_signin'];
                $msg        =    '第一次签到';
            }
            $arr    =    array();
            $nid    =    $userinfoM -> addMemberreg(array('uid'=>$this->member['uid'],'usertype'=>$this->member['usertype'],'date'=>$date,"ctime"=>time(),'ip'=>fun_ip_get()));
            if($nid){
                $IntegralM->company_invtal($this->member['uid'],$this->member['usertype'],$integral,true,$msg,true,2,'integral');        
                $userinfoM -> upInfo(array('uid'=>$this->member['uid']),array('signday'=>$signday,'signdays'=>array('+','1')));            
                $data['msg']    =    '签到成功!+'.$integral.$this->config['integral_pricename'];
                $data['error']    =    1;                
            }else{
                $data['msg']    =    '签到失败!';
                $data['error']    =    2;
            }
        }else{
            $data['msg']    =    '签到失败!';
            $data['error']    =    2;
        }
        $this->render_json($data['error'],$data['msg'],$data);
    }
    /**
     * 检测职位发布数量
     */
    function addCheck_action()
    {
        $jobM    =  $this->MODEL('job');
        $provider = isset($_POST['provider'])?$_POST['provider']:'';
        $need    =  $jobM -> getAddJobNeedInfo($this->member['uid'], 1, '', 1,array('provider'=>$provider));
        
        if(!empty($need['wxapp'])){
            
            $this->render_json(0, 'ok', array('need'=>$need['wxapp']));
        }
        
        $result  =  $this->day_check($this->member['uid'], 'jobnum');
        
        if ($result['status'] == 1){
            $suid     =    $this->member['spid'] ? $this->member['spid'] : $this->member['uid'];
            $statis  =  $this -> company_statis($suid);
            if($statis['addjobnum']!=1){
                if($this->member['spid']){
                    $return['msg']='当前账户套餐余量不足,请联系主账户增配!';
                }else{
                    $return['msg']='套餐已用完 , 立即升级VIP?';
                }
            }
            $return['num']=$statis['addjobnum'];
            $return['spid']=$this->member['spid'];
            $this->render_json(0, 'ok',$return);
            
        }else{
            
            $this->render_json(-1, $result['msg']);
        }
    }
 
    /**
     * 检测视频面试发布数量
     */
    function spviewCheck_action(){
         
        $result  =  $this->day_check($this->member['uid'], 'spview');
        
        if ($result['status'] == 1){
            $suid     =    $this->member['spid'] ? $this->member['spid'] : $this->member['uid'];
            $statis  =  $this -> company_statis($suid);
            
            $this->render_json(0, 'ok', array('num'=>$statis['spviewNum'],'spid'=>$this->member['spid']));
            
        }else{
            
            $this->render_json(-1, $result['msg']);
        }
    }
 
 
    function getHbList_action()
    {
 
        if ($this->config['sy_haibao_isopen'] == 1){
 
            $WhbM               =   $this->MODEL('whb');
            $hbList             =   $WhbM->getWhbList(array('type' => 2, 'isopen' => '1'), array('only' => 1));
            $return['hbList']   =   $hbList;
 
            $jobM               =   $this->MODEL('job');
            $jobList            =   $jobM->getHbJobList(array('uid' => $this->member['uid'], 'state' => 1, 'status' => 0, 'r_status' => 1), array('field' => '`id`,`name`'));
            $return['jobList']  =    $jobList;
 
            $this->render_json(0, '', $return);
        }else{
            $this->render_json(-1, '暂未开启海报分享');
        }
 
    }
 
}