Browse Source

Merge branch 'coupon_rebate' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into coupon_rebate

master
liangyuyan 6 years ago
parent
commit
ed35348962
  1. 2
      app/Controller/CouponRebateController.php
  2. 7
      app/Service/CouponRebate.php
  3. 2
      app/Service/CouponRebateInterface.php
  4. 2
      config/autoload/dependencies.php

2
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;

7
app/CouponRebate/CouponRebate.php → app/Service/CouponRebate.php

@ -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;
}

2
app/CouponRebate/CouponRebateInterface.php → app/Service/CouponRebateInterface.php

@ -1,6 +1,6 @@
<?php
namespace App\CouponRebate;
namespace App\Service;
interface CouponRebateInterface
{

2
config/autoload/dependencies.php

@ -15,5 +15,5 @@ return [
\App\Service\ParamsTokenServiceInterface::class => \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,
];
Loading…
Cancel
Save