Model_user.php 676 B

12345678910111213141516171819202122232425
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. class Model_user extends Lin_Model
  3. {
  4. function __construct(){
  5. parent::__construct();
  6. $this->load->database();
  7. $this->table = 'user';
  8. $this->load_table('user');
  9. }
  10. /** 通过userid查找 */
  11. public function get_uid($userid,$own)
  12. {
  13. return $this->find("userid = '$userid' and own = '$own'");
  14. }
  15. /** 通过API查找 */
  16. public function get_api($api)
  17. {
  18. return $this->find("api = '$api'");
  19. }
  20. /** 更新登陆信息 */
  21. public function get_land($data)
  22. {
  23. $this->save(array('newtime'=>time(),'oldtime'=>$data['newtime']),$data['id']);
  24. }
  25. } //end class