Coupon.php 719 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2019/3/29
  6. * Time: 15:37
  7. */
  8. namespace app\frontend\modules\order\operations\member;
  9. use app\frontend\modules\coupon\models\ShoppingShareCoupon;
  10. use app\frontend\modules\order\operations\OrderOperation;
  11. class Coupon extends OrderOperation
  12. {
  13. public function getApi()
  14. {
  15. return 'coupon.share-coupon.share';
  16. }
  17. public function getName()
  18. {
  19. return '分享';
  20. }
  21. public function getValue()
  22. {
  23. return static::COUPON;
  24. }
  25. public function enable()
  26. {
  27. if (ShoppingShareCoupon::where('order_id', $this->order->id)->first()) {
  28. return true;
  29. }
  30. return false;
  31. }
  32. }