MemberDouyinModel.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Author: 芸众商城 www.yunzshop.com
  4. * Date: 2019/11/4
  5. * Time: 下午4:29
  6. */
  7. namespace app\common\models;
  8. /**
  9. * @property string $openid
  10. *
  11. * Class MemberMiniAppModel
  12. * @package app\common\models
  13. */
  14. class MemberDouyinModel extends BaseModel
  15. {
  16. public $table = 'yz_member_douyin';
  17. /**
  18. * 获取用户信息
  19. *
  20. * @param $memberId
  21. * @return mixed
  22. */
  23. public static function getFansById($memberId)
  24. {
  25. return self::uniacid()
  26. ->where('member_id', $memberId)
  27. ->first();
  28. }
  29. /**
  30. * 获取粉丝uid
  31. *
  32. * @param $openid
  33. * @return mixed
  34. */
  35. public static function getUId($openid)
  36. {
  37. return self::select('member_id')
  38. ->uniacid()
  39. ->where('openid', $openid)
  40. ->first();
  41. }
  42. /**
  43. * 删除会员信息
  44. *
  45. * @param $id
  46. */
  47. public static function deleteMemberInfoById($id)
  48. {
  49. return self::uniacid()
  50. ->where('member_id', $id)
  51. ->delete();
  52. }
  53. }