12345678910111213141516171819202122232425262728 |
- <?php
- namespace Demo\Service;
- use Dever;
- class Cat
- {
- public function test()
- {
- return 1;
- }
- public function data($id, $name)
- {
- //return $name;
- //all one insert update delete
- //return array('name' => 'test', 'id' => 1);
- $cat = Dever::db('demo/cat');
- $one = $cat->query('select * from {table} where state = :0', array(':0' => 1))->fetchAll();
- $data['name'] = '服饰';
- $data['where_id'] = 2;
- //$id = $cat->insert($data);
- //$cat->update($data);
- $data = $cat->getList(array('option_state' => 1));
- return $data;
- }
- }
|