hasOne(User::class, 'id', 'user_id'); } // 关联订单 function order() { return $this->hasOne(Order::class, 'oid', 'order_id'); } function getBeforeAttribute($value) { return $this->attributes['before'] = flowAutoShow($value); } function getAfterAttribute($value) { return $this->attributes['after'] = flowAutoShow($value); } }