|
|
@@ -143,14 +143,20 @@ class UserService extends BaseService
|
|
|
}
|
|
|
|
|
|
//注册成为会员,并更新用户相关信息 shish 2019.9.7
|
|
|
- public static function becomeVip($userId, $merchantId, $data)
|
|
|
+ public static function becomeVip($user, $merchant, $data)
|
|
|
{
|
|
|
$data['member'] = 0;
|
|
|
+ $userId = $user['id'];
|
|
|
+ $merchantId = $merchant['id'];
|
|
|
self::updateById($userId, $data);
|
|
|
UserAssetClass::updateByCondition(['userId' => $userId, ['member' => 0]]);
|
|
|
+ //注意成为会员和关注公众号时要去检查是否符合发优惠券条件
|
|
|
+ $userAsset = UserAssetClass::getByUserId($userId);
|
|
|
+ CouponAssetClass::giveCoupon($user, $merchant, $userAsset);
|
|
|
+ //增加会员数
|
|
|
MerchantAssetService::addMemberNum($merchantId);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//取消关注 shish 2019.9.8
|
|
|
public static function unFocus($userId, $merchantId)
|
|
|
{
|