Cat.php 630 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Demo\Service;
  3. use Dever;
  4. class Cat
  5. {
  6. public function test()
  7. {
  8. return 1;
  9. }
  10. public function data($id, $name)
  11. {
  12. //return $name;
  13. //all one insert update delete
  14. //return array('name' => 'test', 'id' => 1);
  15. $cat = Dever::db('demo/cat');
  16. $one = $cat->query('select * from {table} where state = :0', array(':0' => 1))->fetchAll();
  17. $data['name'] = '服饰';
  18. $data['where_id'] = 2;
  19. //$id = $cat->insert($data);
  20. //$cat->update($data);
  21. $data = $cat->getList(array('option_state' => 1));
  22. return $data;
  23. }
  24. }