Răsfoiți Sursa

新客红包

shish 4 ani în urmă
părinte
comite
c7fc1f352b

+ 1 - 1
app-hd/controllers/HbController.php

@@ -32,7 +32,7 @@ class HbController extends BaseController
         }
         $new = $ghs->new ?? 0;
         if ($new == 0) {
-            util::fail('活动已失效');
+            util::fail('新人才能领取哦');
         }
         $customId = $ghs->customId ?? 0;
         $custom = CustomClass::getById($customId, true);

+ 1 - 2
biz/market/classes/TjFlClass.php

@@ -4,7 +4,6 @@ namespace biz\market\classes;
 
 use biz\base\classes\BaseClass;
 use biz\hb\classes\HbClass;
-use biz\shop\classes\ShopCouponClass;
 
 class TjFlClass extends BaseClass
 {
@@ -15,7 +14,7 @@ class TjFlClass extends BaseClass
     public static function giveGift($ghs, $custom, $beTjCustom)
     {
         $shopId = $ghs->shopId ?? 0;
-        $flData = self::getAllByCondition(['shopId' => $shopId], null, '*');
+        $flData = self::getAllByCondition(['shopId' => $shopId], null, '*', null, true);
         if (empty($flData)) {
             return false;
         }

+ 6 - 2
biz/market/classes/XrFlClass.php

@@ -15,12 +15,12 @@ class XrFlClass extends BaseClass
     public static function giveGift($ghs, $custom)
     {
         $shopId = $ghs->shopId ?? 0;
-        $flData = self::getAllByCondition(['shopId' => $shopId], null, '*');
+        $flData = self::getAllByCondition(['shopId' => $shopId], null, '*', null, true);
         if (empty($flData)) {
             util::fail('红包发完了');
         }
 
-        $ghsId = $item->id ?? 0;
+        $ghsId = $ghs->id ?? 0;
         $ghsName = $ghs->name ?? '';
         $ghsAvatar = $ghs->avatar ?? '';
         $ghsSjId = $ghs->sjId ?? 0;
@@ -73,6 +73,10 @@ class XrFlClass extends BaseClass
             }
 
         }
+        $ghs->sendNewGift = 1;
+        $ghs->save();
+        $custom->getNewGift = 1;
+        $custom->save();
     }
 
 }