You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
903 B

6 years ago
6 years ago
6 years ago
  1. <?php
  2. namespace App\CouponRebate;
  3. use Hyperf\DbConnection\Db;
  4. use Hyperf\HttpServer\Contract\RequestInterface;
  5. use Hyperf\Di\Annotation\Inject;
  6. use Hyperf\Paginator\Paginator;
  7. class CouponRebate implements CouponRebateInterface
  8. {
  9. public function isCouponRebate($user_id)
  10. {
  11. $res = Db::table('ims_system_coupon_user as u')
  12. ->leftjoin('ims_system_coupon_user_receive as r','u.id','=','r.system_coupon_user_id')
  13. ->where([
  14. ['r.user_id','=',$user_id],
  15. ['r.receive_type','=',4],
  16. ['u.active_type','=',2],
  17. ])
  18. ->select('r.id')
  19. ->first();
  20. return $res;
  21. }
  22. public function getActiveInfo()
  23. {
  24. $res = Db::table('ims_system_coupon_user')
  25. ->where([
  26. ['active_type','=',2],
  27. ])
  28. ->get();
  29. return $res;
  30. }
  31. }