|
|
@@ -23,26 +23,6 @@ class HbController extends BaseController
|
|
|
//获取新人红包福利 ssh 20211026
|
|
|
public function actionGetNewGift()
|
|
|
{
|
|
|
- $ghsId = Yii::$app->request->get('ghsId', 0);
|
|
|
- $ghs = GhsClass::getById($ghsId, true);
|
|
|
- GhsClass::valid($ghs, $this->shopId);
|
|
|
- $ghsShopId = $ghs->shopId ?? 0;
|
|
|
- $ghsShop = ShopClass::getById($ghsShopId, true);
|
|
|
- $xrFl = $ghsShop->xrFl ?? 0;
|
|
|
- if ($xrFl == 0) {
|
|
|
- util::fail('活动已结束');
|
|
|
- }
|
|
|
- $sendNewGift = $ghs->sendNewGift ?? 0;
|
|
|
- if ($sendNewGift == 1) {
|
|
|
- util::fail('已经领过了');
|
|
|
- }
|
|
|
- $new = $ghs->new ?? 0;
|
|
|
- if ($new == 0) {
|
|
|
- util::fail('新人才能领取哦');
|
|
|
- }
|
|
|
- $customId = $ghs->customId ?? 0;
|
|
|
- $custom = CustomClass::getById($customId, true);
|
|
|
- XrFlClass::giveGift($ghs, $custom);
|
|
|
util::complete('领取成功');
|
|
|
}
|
|
|
|
|
|
@@ -119,6 +99,9 @@ class HbController extends BaseController
|
|
|
}
|
|
|
$post = $form->attributes;
|
|
|
|
|
|
+ $adminId = $this->shopAdminId;
|
|
|
+ util::checkRepeatCommit($adminId, 5);
|
|
|
+
|
|
|
$duration = (int)$form->days;
|
|
|
$count = $post['count'] ?? 1;
|
|
|
$beginTime = time();
|