|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace App\CouponRebate; |
|
|
|
namespace App\Service; |
|
|
|
|
|
|
|
use Hyperf\DbConnection\Db; |
|
|
|
use Hyperf\HttpServer\Contract\RequestInterface; |
|
|
|
@ -26,10 +26,15 @@ class CouponRebate implements CouponRebateInterface |
|
|
|
|
|
|
|
public function getActiveInfo() |
|
|
|
{ |
|
|
|
$time = time(); |
|
|
|
$res = Db::table('ims_system_coupon_user') |
|
|
|
->where([ |
|
|
|
['status','=',1], |
|
|
|
['active_type','=',2], |
|
|
|
['start_time','<=',$time], |
|
|
|
['end_time','>',$time], |
|
|
|
]) |
|
|
|
->whereRaw('inventory > inventory_use') |
|
|
|
->get(); |
|
|
|
return $res; |
|
|
|
} |