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 yqmb_controller extends company
{
 
    /**
     * @desc 子账号列表
     * 2019-06-28
     */
    public function index_action()
    {
        
        // 企业账号通用信息
        $this   ->  public_action();
        $this   ->  company_satic();
       
        $yqmbM          =   $this -> MODEL('yqmb');
  
        $where          =   array('uid' => $this -> uid);
        
        $urlarr         =   array('c' => 'yqmb', 'page' => '{{page}}');
 
        $pageurl        =   Url('member', $urlarr);
 
        $pageM          =   $this -> MODEL('page');
        
        $pages          =   $pageM -> pageList('yqmb', $where, $pageurl, $_GET['page']);
        
        // 子账号列表
        if ($pages['total'] > 0) {
            
            $where['orderby']   =   'id,desc';
            $where['limit']     =   $pages['limit'];
            $rows               =   $yqmbM -> getList($where);
        }
       
        $this -> yunset('totalNum', $pages['total']);
        $this -> yunset('rows', $rows);
 
        $this -> com_tpl('yqmb');
    }
 
    /**
     * @desc 添加 修改子账号
     * 2019-06-28
     */
    public function editSave_action()
    {
        $_POST  =   $this -> post_trim($_POST);
        $yqmbM  =   $this->MODEL('yqmb');
 
        $where  =   array();
 
        if($_POST['yid']){
            
            $where['id']=   $_POST['yid'];
            
        }
 
        $data = array(
            'uid'       =>  $this->uid
        );
        $setdata = array(
            'name'      => $_POST['name'],
            'linkman'   => $_POST['linkman'],
            'linktel'   => $_POST['linktel'],
            'content'   => $_POST['content'],
            'intertime' => $_POST['intertime'],
            'address'   => $_POST['address'],
        );
        $return         =   $yqmbM->addInfo($setdata,$data,$where);
 
        // 返回值
        if ($return['errcode'] == 9) {
            
            $this->ACT_layer_msg($return['msg'], 9,$_SERVER['HTTP_REFERER']);
        } else {
            
            $this->ACT_layer_msg($return['msg'], 8);
        }
    }
 
    /**
     * 绑定 解绑子账号
     * 2019-06-28
     */
    public function del_action()
    {
        $_POST  =   $this -> post_trim($_POST);
 
        $yqmbM  =   $this -> MODEL('yqmb');
 
        $res    =   $yqmbM->delYqmb($_POST['id'],array('uid'=>$this->uid));
 
        echo json_encode($res);
        
        die();
    }
 
    
    
}
?>