product.php 784 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. class product extends DooModel {
  4. public $pid;
  5. public $title;
  6. public $typeid;
  7. public $_table = 'CLD_product';
  8. public $_primarykey = 'pid';
  9. public $_fields = array ('pid', 'title','typeid');
  10. public function checkUser($uid,$passwork){
  11. return $this->find ( array ('where' => "uid= '".$uid."' and passwork = '".addslashes($passwork)."'", 'asArray' => TRUE ) );
  12. }
  13. public function getProudct() {
  14. return $this->find ( array ('desc' => 'pid', 'asArray' => TRUE ) );
  15. }
  16. function getProductById($pid = 0 ) {
  17. return $this->find ( array ( 'where' => 'pid=' . $pid, 'asArray' => TRUE ) );
  18. }
  19. public function getUserByIdList($puid){
  20. return $this->find ( array ('where' => "uid= '".$puid."'", 'asArray' => TRUE ) );
  21. }
  22. }
  23. ?>