StoreProductAttrValue.php 504 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\model\api;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class StoreProductAttrValue extends Model
  9. {
  10. protected $name = 'store_product_attr_value';
  11. /**
  12. * 根据规格获取SKU
  13. * @param int $productId
  14. * @param string $suk
  15. * @return array|null
  16. */
  17. public function getSkuBySuk($productId, $suk)
  18. {
  19. return $this->where('product_id', $productId)
  20. ->where('suk', $suk)
  21. ->find();
  22. }
  23. }