ProductPart.php 762 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use addons\qingdongams\model\File;
  4. use think\Exception;
  5. use think\Model;
  6. use traits\model\SoftDelete;
  7. /**
  8. *产品零件表
  9. */
  10. class ProductPart Extends Model
  11. {
  12. use SoftDelete;
  13. // 表名,不含前缀
  14. protected $name = 'qingdongams_product_part';
  15. // 开启自动写入时间戳字段
  16. protected $autoWriteTimestamp = 'int';
  17. // 定义时间戳字段名
  18. protected $createTime = 'createtime';
  19. protected $updateTime = 'updatetime';
  20. protected $deleteTime = 'deletetime';
  21. public function getImgAttr($value) {
  22. if ($value) {
  23. return cdnurl(File::getUrl($value), true);
  24. } else {
  25. return $value;
  26. }
  27. }
  28. }