MemberDouyinModel.php 1009 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 19/11/4
  6. * Time: 上午10:44
  7. */
  8. /**
  9. * 字节跳动小程序登录表
  10. */
  11. namespace app\frontend\modules\member\models;
  12. class MemberDouyinModel extends \app\common\models\MemberDouyinModel
  13. {
  14. public static function insertData($data)
  15. {
  16. self::insert($data);
  17. }
  18. public static function getUserInfo($openid)
  19. {
  20. return self::uniacid()
  21. ->where('openid', $openid)
  22. ->first();
  23. }
  24. public static function updateUserInfo($openid, $data)
  25. {
  26. return self::uniacid()
  27. ->where('openid', $openid)
  28. ->update($data);
  29. }
  30. public static function updateData($uid, $data)
  31. {
  32. self::uniacid()
  33. ->where('member_id', $uid)
  34. ->update($data);
  35. }
  36. public static function getMemberByToken($token)
  37. {
  38. return self::uniacid()
  39. ->where('access_token', $token)
  40. ->first();
  41. }
  42. }