colly_wyx
2018-04-18 2ee7d19834f3d566579df33e8b86c8ee1d350238
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
<?php
 
class Domain_Examples_CURD {
 
    public function insert($newData) {
        $newData['post_date'] = date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']);
 
        $model = new Model_Examples_CURD();
        return $model->insert($newData);
    }
 
    public function update($id, $newData) {
        $model = new Model_Examples_CURD();
        return $model->update($id, $newData);
    }
 
    public function get($id) {
        $model = new Model_Examples_CURD();
        return $model->get($id);
    }
 
    public function delete($id) {
        $model = new Model_Examples_CURD();
        return $model->delete($id);
    }
 
    public function getList($state, $page, $perpage) {
        $rs = array('items' => array(), 'total' => 0);
 
        $model = new Model_Examples_CURD();
        $items = $model->getListItems($state, $page, $perpage);
        $total = $model->getListTotal($state);
 
        $rs['items'] = $items;
        $rs['total'] = $total;
 
        return $rs;
    }
}