|
|
@@ -166,19 +166,7 @@ class ShopCouponClass extends BaseClass
|
|
|
// 商家是否有可用红包
|
|
|
public static function hasValidCoupon($shopId, $ghsId)
|
|
|
{
|
|
|
- $current = date("Y-m-d H:i:s");
|
|
|
- $list = self::getAllByCondition(['shopId' => $shopId, 'status' => ShopCouponClass::STATUS_UN_USE, 'ghsId' => $ghsId], null, '*', null, true);
|
|
|
- $flag = 0;
|
|
|
- if (empty($list)) {
|
|
|
- return $flag;
|
|
|
- }
|
|
|
- foreach ($list as $item) {
|
|
|
- if ($current >= $item->beginTime && $current < $item->endTime) {
|
|
|
- $flag = 1;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return $flag;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static function valid($coupon, $shopId)
|