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
<?php
 
class templates_model extends model{
    
    /*
     * 获取配置列表
     * $whereData     查询条件
     * $data         自定义处理数组
     */
     
    function getList($whereData,$data=array()){
        $ListNew    =    array();
        $List        =    $this -> select_all('templates',$whereData);
        
        if(!empty( $List )){
            
            $ListNew['list']    =    $List;
        }
 
        return    $ListNew;
    }
    
    /*
    * 获取配置详情
    * $whereData     查询条件
    * $data         自定义处理数组
    *
    */
    
 
    function getInfo($whereData, $data = array()){
        
        if($whereData){
            $data['field']  =    empty($data['field']) ? '*' : $data['field'];
        
            $List    =    $this -> select_once('templates',$whereData,$data['field']);
        }
 
        return $List;
    
    }
 
    /*
    * 创建配置
    * $setData     自定义处理数组
    *
    */
    
 
    function addInfo($setData){
 
        if(!empty($setData)){
            
            $nid    =    $this -> insert_into('templates',$setData);
            
        }
 
        return $nid;
    
    }
 
    /*
    * 更新配置
    * $whereData     查询条件
    * $data         自定义处理数组
    *
    */
 
    function upInfo($whereData, $data = array()){
 
        if(!empty($whereData)){
            
            $nid    =    $this -> update_once('templates',$data,$whereData);
            
        }
 
        return $nid;
    
    }
    /*
    * 查询数量
    * $whereData     查询条件
    *
    */
 
    function getNum($whereData){
 
        if(!empty($whereData)){
            
            $num    =    $this -> select_num('templates',$whereData);
            
        }
 
        return $num;
    
    }
    
}
?>