ServiceRel.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\common\model\goods;
  13. use app\common\model\BaseModel;
  14. /**
  15. * 商品服务与承诺模型
  16. * Class ServiceRel
  17. */
  18. class ServiceRel extends BaseModel
  19. {
  20. // 定义表名
  21. protected $name = 'goods_service_rel';
  22. // 定义主键
  23. protected $pk = 'id';
  24. protected $updateTime = false;
  25. /**
  26. * 获取商品服务与承诺ID集
  27. * @param int $goodsId
  28. * @return array
  29. */
  30. public static function getServiceIds(int $goodsId)
  31. {
  32. return (new static)->where('goods_id', '=', $goodsId)->column('service_id');
  33. }
  34. }