FullSendGoods.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\model\fullsend;
  13. use app\common\model\fullsend\FullSendGoods as FullSendModel;
  14. /**
  15. * 满就送商品模型
  16. * Class Coupon
  17. * @package app\store\model
  18. */
  19. class FullSendGoods extends FullSendModel
  20. {
  21. /**
  22. * 商品是否在有效活动中
  23. * @param $actId
  24. * @param $isExcept
  25. * @param $goodsId
  26. * @return bool
  27. * @throws \think\db\exception\DataNotFoundException
  28. * @throws \think\db\exception\DbException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. */
  31. public static function justiceGoods($actId, $isExcept, $goodsId)
  32. {
  33. $res = self::where('full_send_activity_id',$actId)->where('goods_id',$goodsId)->find();
  34. return $isExcept == 1?boolval(!$res):$res;
  35. }
  36. }