Oggame_user.php 771 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: ikeke
  5. * Date: 2018/12/24
  6. * Time: 17:55
  7. */
  8. namespace App\Models;
  9. class Oggame_user extends BaseModel
  10. {
  11. protected $table = "oggame_user";
  12. public $timestamps = false;
  13. public function getUser($username,$type)
  14. {
  15. $data = $this->where('lo_name', $username)->where('game_type', $type)->first();
  16. return $data;
  17. }
  18. public function getGameUser($username,$type)
  19. {
  20. $data = $this->where('rp_name', $username)->where('game_type', $type)->first();
  21. return $data;
  22. }
  23. public function insertUser($data)
  24. {
  25. $data = $this->insert($data);
  26. if(!$data)
  27. {
  28. return -1;
  29. }
  30. else
  31. {
  32. return 1;
  33. }
  34. }
  35. }