diff --git a/app/Controller/CouponRebateController.php b/app/Controller/CouponRebateController.php index 51f8b78..43a73e9 100644 --- a/app/Controller/CouponRebateController.php +++ b/app/Controller/CouponRebateController.php @@ -14,7 +14,7 @@ namespace App\Controller; use Hyperf\DbConnection\Db; use Hyperf\Redis\Redis; use Hyperf\Utils\ApplicationContext; -use App\CouponRebate\CouponRebateInterface; +use App\Service\CouponRebateInterface; use http\Client\Curl\User; use Hyperf\Di\Annotation\Inject; use App\Model\Coupon; diff --git a/app/CouponRebate/CouponRebate.php b/app/Service/CouponRebate.php similarity index 80% rename from app/CouponRebate/CouponRebate.php rename to app/Service/CouponRebate.php index d61e2d8..a171bb8 100644 --- a/app/CouponRebate/CouponRebate.php +++ b/app/Service/CouponRebate.php @@ -1,6 +1,6 @@ where([ + ['status','=',1], ['active_type','=',2], + ['start_time','<=',$time], + ['end_time','>',$time], ]) + ->whereRaw('inventory > inventory_use') ->get(); return $res; } diff --git a/app/CouponRebate/CouponRebateInterface.php b/app/Service/CouponRebateInterface.php similarity index 81% rename from app/CouponRebate/CouponRebateInterface.php rename to app/Service/CouponRebateInterface.php index 385f1a7..add5ecd 100644 --- a/app/CouponRebate/CouponRebateInterface.php +++ b/app/Service/CouponRebateInterface.php @@ -1,6 +1,6 @@ \App\Service\ParamsTokenSsdbService::class, \App\Service\AdServiceInterface::class => \App\Service\AdService::class, \App\Commons\Log::class => \App\Commons\Log::class, - \App\CouponRebate\CouponRebateInterface::class => \App\CouponRebate\CouponRebate::class, + \App\Service\CouponRebateInterface::class => \App\Service\CouponRebate::class, ];