|
@@ -4,6 +4,7 @@ namespace biz\shop\classes;
|
|
|
|
|
|
|
|
use biz\base\classes\BaseClass;
|
|
use biz\base\classes\BaseClass;
|
|
|
use biz\ghs\classes\GhsClass;
|
|
use biz\ghs\classes\GhsClass;
|
|
|
|
|
+use bizGhs\custom\classes\CustomClass;
|
|
|
use common\components\noticeUtil;
|
|
use common\components\noticeUtil;
|
|
|
use common\components\util;
|
|
use common\components\util;
|
|
|
|
|
|
|
@@ -43,6 +44,7 @@ class ShopCouponClass extends BaseClass
|
|
|
]
|
|
]
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ //发放红包 shish 20211002
|
|
|
public static function giveCoupon($recharge)
|
|
public static function giveCoupon($recharge)
|
|
|
{
|
|
{
|
|
|
$sjId = $recharge->sjId ?? 0;
|
|
$sjId = $recharge->sjId ?? 0;
|
|
@@ -58,6 +60,28 @@ class ShopCouponClass extends BaseClass
|
|
|
noticeUtil::push("充值成功但红包没有发放成功,数量:{$hbNum} 金额:{$amount} id:{$rechargeId}", '15280215347');
|
|
noticeUtil::push("充值成功但红包没有发放成功,数量:{$hbNum} 金额:{$amount} id:{$rechargeId}", '15280215347');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ $ghs = GhsClass::getById($ghsId, true);
|
|
|
|
|
+ if (empty($ghs)) {
|
|
|
|
|
+ noticeUtil::push("充值成功但红包没有发放成功,没有找到供货商,数量:{$hbNum} 金额:{$amount} id:{$rechargeId}", '15280215347');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $ghsName = $ghs->name ?? '';
|
|
|
|
|
+ $ghsAvatar = $ghs->avatar ?? '';
|
|
|
|
|
+ $ghsSjId = $ghs->sjId ?? 0;
|
|
|
|
|
+ $ghsShopId = $ghs->shopId ?? 0;
|
|
|
|
|
+ $customId = $ghs->customId ?? 0;
|
|
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
|
|
+ if (empty($custom)) {
|
|
|
|
|
+ noticeUtil::push("充值成功但红包没有发放成功,没有找到客户,数量:{$hbNum} 金额:{$amount} id:{$rechargeId}", '15280215347');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $customName = $custom->name ?? '';
|
|
|
|
|
+ $customPy = $custom->py ?? '';
|
|
|
|
|
+ $customAvatar = $custom->avatar ?? '';
|
|
|
|
|
+ $customSjId = $custom->sjId ?? 0;
|
|
|
|
|
+ $customShopId = $custom->shopId ?? 0;
|
|
|
|
|
+
|
|
|
for ($i = 0; $i < $hbNum; $i++) {
|
|
for ($i = 0; $i < $hbNum; $i++) {
|
|
|
$start = date("Y-m-d H:i:s");
|
|
$start = date("Y-m-d H:i:s");
|
|
|
$end = date("Y-m-d H:i:s", time() + $valid * 86400);
|
|
$end = date("Y-m-d H:i:s", time() + $valid * 86400);
|
|
@@ -66,11 +90,21 @@ class ShopCouponClass extends BaseClass
|
|
|
'shopId' => $shopId,
|
|
'shopId' => $shopId,
|
|
|
'beginTime' => $start,
|
|
'beginTime' => $start,
|
|
|
'endTime' => $end,
|
|
'endTime' => $end,
|
|
|
- 'name' => '红包券',
|
|
|
|
|
|
|
+ 'name' => '红包',
|
|
|
'amount' => $hbAmount,
|
|
'amount' => $hbAmount,
|
|
|
'miniCost' => $miniExpend,
|
|
'miniCost' => $miniExpend,
|
|
|
'status' => self::STATUS_UN_USE,
|
|
'status' => self::STATUS_UN_USE,
|
|
|
'ghsId' => $ghsId,
|
|
'ghsId' => $ghsId,
|
|
|
|
|
+ 'ghsName' => $ghsName,
|
|
|
|
|
+ 'ghsAvatar' => $ghsAvatar,
|
|
|
|
|
+ 'ghsSjId' => $ghsSjId,
|
|
|
|
|
+ 'ghsShopId' => $ghsShopId,
|
|
|
|
|
+ 'customId' => $customId,
|
|
|
|
|
+ 'customName' => $customName,
|
|
|
|
|
+ 'customPy' => $customPy,
|
|
|
|
|
+ 'customAvatar' => $customAvatar,
|
|
|
|
|
+ 'customSjId' => $customSjId,
|
|
|
|
|
+ 'customShopId' => $customShopId,
|
|
|
];
|
|
];
|
|
|
self::add($coupon);
|
|
self::add($coupon);
|
|
|
}
|
|
}
|