MemberMiniAppModel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Author: 芸众商城 www.yunzshop.com
  4. * Date: 2017/8/2
  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 MemberMiniAppModel extends BaseModel
  15. {
  16. public $table = 'yz_member_mini_app';
  17. public $primaryKey = 'mini_app_id';
  18. /**
  19. * 获取用户信息
  20. *
  21. * @param $memberId
  22. * @return mixed
  23. */
  24. public static function getFansById($memberId)
  25. {
  26. return self::uniacid()
  27. ->where('member_id', $memberId)
  28. ->orderBy('mini_app_id', 'desc')
  29. ->first();
  30. }
  31. /**
  32. * 获取粉丝uid
  33. *
  34. * @param $openid
  35. * @return mixed
  36. */
  37. public static function getUId($openid)
  38. {
  39. return self::select('member_id', 'mini_app_id')
  40. ->uniacid()
  41. ->where('openid', $openid)
  42. ->first();
  43. }
  44. /**
  45. * 删除会员信息
  46. *
  47. * @param $id
  48. */
  49. public static function deleteMemberInfoById($id)
  50. {
  51. return self::uniacid()
  52. ->where('member_id', $id)
  53. ->delete();
  54. }
  55. }