UserDataModifyLog.php 698 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  5. /**
  6. * 用户流量变动记录
  7. */
  8. class UserDataModifyLog extends Model {
  9. public const UPDATED_AT = null;
  10. protected $table = 'user_data_modify_log';
  11. // 关联账号
  12. public function user(): BelongsTo {
  13. return $this->belongsTo(User::class);
  14. }
  15. // 关联订单
  16. public function order(): BelongsTo {
  17. return $this->belongsTo(Order::class);
  18. }
  19. public function getBeforeAttribute($value) {
  20. return $this->attributes['before'] = flowAutoShow($value);
  21. }
  22. public function getAfterAttribute($value) {
  23. return $this->attributes['after'] = flowAutoShow($value);
  24. }
  25. }