hasOne(SsNode::class, 'id', 'node_id'); } // 用户每时使用总流量 public function scopeUserHourly($query, $uid) { return $query->whereUserId($uid)->whereNodeId(0); } }