|
|
@@ -14,7 +14,7 @@ class InviteService extends BaseService
|
|
|
{
|
|
|
|
|
|
public static $baseFile = '\biz\invite\classes\InviteClass';
|
|
|
-
|
|
|
+
|
|
|
//取详情 shish 2019.12.18
|
|
|
public static function getDetail($id)
|
|
|
{
|
|
|
@@ -52,12 +52,12 @@ class InviteService extends BaseService
|
|
|
return InviteClass::hasNewGift($userInfo);
|
|
|
}
|
|
|
|
|
|
- //邀请有礼,领取奖励 shish 2019.12.14
|
|
|
+ //领取邀请有礼 shish 2019.12.14
|
|
|
public static function getNewGift($userInfo, $introUserId)
|
|
|
{
|
|
|
$newUser = UserService::newUser($userInfo);
|
|
|
if ($newUser == false) {
|
|
|
- util::fail('新人才能领取哦');
|
|
|
+ util::fail('新人才能领哦');
|
|
|
}
|
|
|
$merchantId = $userInfo['merchantId'];
|
|
|
$gift = InviteAssetClass::newGift($merchantId);
|
|
|
@@ -66,7 +66,7 @@ class InviteService extends BaseService
|
|
|
}
|
|
|
$hasInvite = InviteClass::hasInvited($userInfo);
|
|
|
if ($hasInvite) {
|
|
|
- util::fail('已经领取过了');
|
|
|
+ util::fail('已经领过了');
|
|
|
}
|
|
|
$userId = $userInfo['id'];
|
|
|
$time = time();
|
|
|
@@ -78,7 +78,15 @@ class InviteService extends BaseService
|
|
|
}
|
|
|
$introMobile = $introduce['mobile'];
|
|
|
$introUserName = $introduce['userName'];
|
|
|
- $data = ['userId' => $userId, 'introUserId' => $introUserId, 'introMobile' => $introMobile, 'introUserName' => $introUserName, 'prize' => $prize, 'addTime' => $time, 'merchantId' => $merchantId];
|
|
|
+ $data = [
|
|
|
+ 'userId' => $userId,
|
|
|
+ 'introUserId' => $introUserId,
|
|
|
+ 'introMobile' => $introMobile,
|
|
|
+ 'introUserName' => $introUserName,
|
|
|
+ 'prize' => $prize,
|
|
|
+ 'addTime' => $time,
|
|
|
+ 'merchantId' => $merchantId
|
|
|
+ ];
|
|
|
$invite = InviteClass::add($data);
|
|
|
$id = $invite['id'];
|
|
|
$now = time();
|
|
|
@@ -102,7 +110,7 @@ class InviteService extends BaseService
|
|
|
$couponId = $coupon['id'];
|
|
|
InviteClass::updateById($id, ['couponId' => $couponId]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//检查邀请有礼的权限 shish 2019.12.18
|
|
|
public static function valid($invite, $merchantId)
|
|
|
{
|
|
|
@@ -113,7 +121,7 @@ class InviteService extends BaseService
|
|
|
util::fail('您没有权限操作');
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function give($invite)
|
|
|
{
|
|
|
if ($invite['status'] != 1) {
|