OrderEffectiveLog.php 564 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\common\model\orders;
  3. use app\common\model\BaseModel;
  4. /**
  5. * @author 林海涛
  6. * @date 2024/7/17 下午5:23
  7. */
  8. class OrderEffectiveLog extends BaseModel
  9. {
  10. protected $name = 'order_effective_log';
  11. public function getEndEffectiveTimeAttr($value,$data)
  12. {
  13. return !empty($data['end_effective_time'])?date('Y-m-d H:i:s',$data['end_effective_time']):'';
  14. }
  15. public static function getEffectiveUnitTextAttr($value,$data)
  16. {
  17. $type = [1 => '天',2=> '小时'];
  18. return $type[$data['effective_unit']];
  19. }
  20. }