ApproveMaintain.php 699 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 审批申请-维修信息模型
  6. */
  7. class ApproveMaintain extends Model
  8. {
  9. // 表名
  10. protected $name = 'approve_maintain';
  11. // 追加属性
  12. protected $append = [
  13. 'images_text',
  14. ];
  15. public function getImagesTextAttr($value, $data)
  16. {
  17. $value = $value ? $value : (isset($data['images']) ? $data['images'] : '');
  18. return $value ? explode(',', $value) : [];
  19. }
  20. public function getFeedbackImagesTextAttr($value, $data)
  21. {
  22. $value = $value ? $value : (isset($data['feedback_images']) ? $data['feedback_images'] : '');
  23. return $value ? explode(',', $value) : [];
  24. }
  25. }