mb_user_token.model.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * 手机端令牌模型
  4. *
  5. *
  6. *
  7. *
  8. */
  9. defined('InShopNC') or exit('Access Invalid!');
  10. class mb_user_tokenModel extends Model
  11. {
  12. public function __construct()
  13. {
  14. parent::__construct('mb_user_token');
  15. }
  16. /**
  17. * 查询
  18. *
  19. * @param array $condition 查询条件
  20. * @return array
  21. */
  22. public function getMbUserTokenInfo($condition)
  23. {
  24. return $this->where($condition)->find();
  25. }
  26. public function getMbUserTokenInfoByToken($token)
  27. {
  28. if (empty($token)) {
  29. return null;
  30. }
  31. return $this->getMbUserTokenInfo(array('token' => $token));
  32. }
  33. /**
  34. * 新增
  35. *
  36. * @param array $param 参数内容
  37. * @return bool 布尔类型的返回结果
  38. */
  39. public function addMbUserToken($param)
  40. {
  41. return $this->insert($param);
  42. }
  43. /**
  44. * 删除
  45. *
  46. * @param int $condition 条件
  47. * @return bool 布尔类型的返回结果
  48. */
  49. public function delMbUserToken($condition)
  50. {
  51. return $this->where($condition)->delete();
  52. }
  53. }