StockWarning.php 750 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\admin\model\shopro\goods;
  3. use think\Model;
  4. use traits\model\SoftDelete;
  5. class StockWarning extends Model
  6. {
  7. use SoftDelete;
  8. // 表名
  9. protected $name = 'shopro_stock_warning';
  10. // 自动写入时间戳字段
  11. protected $autoWriteTimestamp = 'int';
  12. // 定义时间戳字段名
  13. protected $createTime = 'createtime';
  14. protected $updateTime = 'updatetime';
  15. protected $deleteTime = 'deletetime';
  16. // 追加属性
  17. protected $append = [
  18. ];
  19. public function goods()
  20. {
  21. return $this->belongsTo(Goods::class, 'goods_id', 'id');
  22. }
  23. public function skuPrice()
  24. {
  25. return $this->belongsTo(SkuPrice::class, 'goods_sku_price_id', 'id');
  26. }
  27. }