GoodsSku.php 1.3 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\index\model;
  13. use app\common\model\GoodsSku as GoodsSkuModel;
  14. /**
  15. * 商品规格模型
  16. * Class GoodsSku
  17. * @package app\api\model
  18. */
  19. class GoodsSku extends GoodsSkuModel
  20. {
  21. /**
  22. * 关联模型:规格图片
  23. * @return \think\model\relation\HasOne
  24. */
  25. public function image(): \think\model\relation\HasOne
  26. {
  27. return parent::image()->bind(['image_url' => 'preview_url']);
  28. }
  29. /**
  30. * 隐藏字段
  31. * @var array
  32. */
  33. protected $hidden = [
  34. 'store_id',
  35. 'create_time',
  36. 'update_time'
  37. ];
  38. }