chengkun
2025-04-29 ab5d7bddae4557b9d56d17f21fc8ca232d7d8693
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
<?php
 
class index_controller extends train{
 
    function index_action(){
    
        $TrainM        =    $this->MODEL('train');
        $UserinfoM    =    $this->MODEL('userinfo');        
        $StatisM    =    $this->MODEL('statis');
        $statis        =    $StatisM->getInfo($this->uid,array('usertype'=>'4'));
        $this->yunset("statis",$statis);
        $where['s_uid']        =    $this->uid;
        $where['orderby']    =    array('id,desc');
        $where['limit']        =    4;
        $zixun    =    $TrainM->getPxzxList($where);
  
        foreach($zixun    as $v){
 
            $uids[]=$v['uid'];
        }
   
        $mwhere['uid']    =    array('in', pylode(',', $uids));
        $minfo            =    $UserinfoM->getList($mwhere,array('field'=>'uid,username'));
  
        if(is_array($zixun)){
 
            foreach($zixun as $k=>$v){
 
                foreach($minfo as $val){
 
                    if($v['uid']==$val['uid']){
 
                        $zixun[$k]['nickname']=$val['username'];
                    }
                }
            }
        }
    
        $this->yunset("zixun",$zixun);
        //课程数目
   
        $subject_num    =    $TrainM->getPxSubjectNum(array('uid'=>$this->uid));
        $this->yunset("subject_num",$subject_num);
   
        //课程预约数目
        //$nwhere['s_uid']    =    $this->uid;
        $baoming_num          =    $TrainM->getPxBaomingNum(array('s_uid'=>$this->uid));
        $this->yunset("baoming_num",$baoming_num);
        //咨询留言数目
        $zixun_num    =    $TrainM->getZixungNum(array('s_uid'=>$this->uid));
        $this->yunset("zixun_num",$zixun_num);
  
        //预约名单
        $bwhere['s_uid']    =    $this->uid;
        $bwhere['orderby']    =    array('id,desc');
        $bwhere['limit']    =    4;
        $baominglist        =    $TrainM->getBmList($bwhere);
        
        foreach($baominglist as $v){
 
            $sid[]=$v['sid'];
        }
 
        $swhere['id']    =    array('in', pylode(',', $sid));
  
        $subjectlist    =    $TrainM->getSubList($swhere,array('field'=>'uid,id,name'));
  
        if(is_array($baominglist) && $baominglist){
 
            foreach($baominglist as $k=>$v){
 
                foreach($subjectlist as $val){
 
                    if($v['sid']==$val['id']){
 
                        $baominglist[$k]['sub_name']    =    $val['name'];
                    }
                }
            }
        }
        $this->yunset("baoming",$baominglist);
            
        $this->train_tpl('index');
    }
 
}
?>