Model_country.php 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. class Model_Country extends Lin_Model
  3. {
  4. function __construct(){
  5. parent::__construct();
  6. $this->load->database();
  7. $this->table = 'country';
  8. $this->load_table('country');
  9. }
  10. /** 通过名查找查找 */
  11. public function get_name($name)
  12. {
  13. return $this->find("name = '$name'");
  14. }
  15. /** 通过英文名查找查找 */
  16. public function get_ename($ename)
  17. {
  18. return $this->find("ename = '$ename'");
  19. }
  20. /** 通过中文名查找 */
  21. public function get_zname($zname)
  22. {
  23. return $this->find("zname = '$zname'");
  24. }
  25. /** 通过所属州查找 */
  26. public function get_continent($continent)
  27. {
  28. return $this->find("continent = '$continent'");
  29. }
  30. /** 通过默认快递查找 */
  31. public function get_express($express)
  32. {
  33. return $this->find("express = '$express'");
  34. }
  35. /** 通过联邦编码查找 */
  36. public function get_al($lb)
  37. {
  38. return $this->find("lb = '$lb'");
  39. }
  40. } //end class