Model_distribution.php 609 B

1234567891011121314151617181920212223
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. class Model_distribution extends Lin_Model
  3. {
  4. function __construct(){
  5. parent::__construct();
  6. $this->load->database();
  7. $this->table = 'distribution';
  8. $this->load_table('distribution');
  9. }
  10. /** 通过API查找 */
  11. public function get_title($title)
  12. {
  13. return $this->find("title = '$title'");
  14. }
  15. public function get_pid($pid)
  16. {
  17. return $this->find("pid = '$pid'");
  18. }
  19. public function ge_size($category,$size)
  20. {
  21. return $this->find("category = '$category' and size = '$size'");
  22. }
  23. } //end class