Model_staff.php 641 B

12345678910111213141516171819202122232425
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. class Model_Staff extends Lin_Model
  3. {
  4. function __construct(){
  5. parent::__construct();
  6. $this->load->database();
  7. $this->table = 'staff';
  8. $this->load_table('staff');
  9. }
  10. /** 通过姓名查找查找 */
  11. public function get_name($name)
  12. {
  13. return $this->find("name = '$name'");
  14. }
  15. /** 通过电话查找查找 */
  16. public function get_phone($phone)
  17. {
  18. return $this->find("phone = '$phone'");
  19. }
  20. /** 通过工号查找查找 */
  21. public function get_number($number)
  22. {
  23. return $this->find("number = '$number'");
  24. }
  25. } //end class